#include "CLucene/StdHeader.h" #ifndef _lucene_search_PrefixQuery #define _lucene_search_PrefixQuery #ifndef NO_PREFIX_QUERY #include "CLucene/index/Term.h" #include "CLucene/index/Terms.h" #include "CLucene/index/IndexReader.h" #include "SearchHeader.h" #include "BooleanQuery.h" #include "TermQuery.h" #include "CLucene/util/StringBuffer.h" using namespace lucene::index; namespace lucene{ namespace search{ /** A Query that matches documents containing terms with a specified prefix. */ class PrefixQuery: public Query { private: Term* prefix; BooleanQuery* query; IndexReader* reader; public: /** Constructs a query for terms starting with prefix. */ PrefixQuery(Term* Prefix); ~PrefixQuery(); const char_t* getQueryName()const; void prepare(IndexReader& reader) ; float_t sumOfSquaredWeights(Searcher& searcher); void normalize(const float_t norm) ; Scorer* scorer(IndexReader& reader) ; BooleanQuery* getQuery() ; /** Prints a user-readable version of this query. */ const char_t* toString(const char_t* field) ; }; }} #endif #endif