/*------------------------------------------------------------------------------
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
*
* Distributable under the terms of either the Apache License (Version 2.0) or
* the GNU Lesser General Public License, as specified in the COPYING file.
------------------------------------------------------------------------------*/
#ifndef _lucene_search_MatchAllDocsQuery_h
#define _lucene_search_MatchAllDocsQuery_h
#include "Scorer.h"
#include "SearchHeader.h"
#include "Query.h"
CL_CLASS_DEF(search,Explanation)
CL_CLASS_DEF(search,Similarity)
CL_CLASS_DEF(index,IndexReader)
CL_NS_DEF(search)
class Weight;
/**
* A query that matches all documents.
*
*/
class CLUCENE_EXPORT MatchAllDocsQuery : public Query {
protected:
MatchAllDocsQuery(const MatchAllDocsQuery& clone);
public:
MatchAllDocsQuery();
virtual ~MatchAllDocsQuery();
class MatchAllScorer;
class MatchAllDocsWeight;
/** Prints a query to a string, with field assumed to be the
* default field and omitted.
*
The representation used is one that is supposed to be readable * by {@link org.apache.lucene.queryParser.QueryParser QueryParser}. However, * there are the following limitations: *
Only implemented by primitive queries, which re-write to themselves. * This is an Internal function */ virtual Weight* _createWeight(Searcher* searcher); public: /** Returns a clone of this query. */ virtual Query* clone() const; /** Expert: MatchAllDocsQuery provides no terms at all. */ void extractTerms( TermSet * termset ) const; virtual bool equals(Query* o) const; virtual size_t hashCode() const; static const char* getClassName(); const char* getObjectName() const; }; CL_NS_END #endif