#include "CLucene/StdHeader.h" #ifndef _lucene_search_BooleanQuery_ #define _lucene_search_BooleanQuery_ #include "CLucene/index/IndexReader.h" #include "CLucene/util/StringBuffer.h" #include "SearchHeader.h" #include "BooleanClause.h" #include "BooleanScorer.h" #include "Scorer.h" using namespace lucene::index; namespace lucene{ namespace search { // A Query that matches documents matching boolean combinations of other // queries, typically {@link TermQuery}s or {@link PhraseQuery}s. class BooleanQuery:public Query { private: lucene::util::VoidListclauses; public: // Constructs an empty boolean query. BooleanQuery(); ~BooleanQuery(); const char_t* getQueryName() const; // Adds a clause to a boolean query. Clauses may be: // //It is an error to specify a clause as both required and //prohibited. void add(Query& query, const bool deleteQuery, const bool required, const bool prohibited); // Adds a clause to a boolean query. void add(BooleanClause& clause); void prepare(IndexReader& reader); //added by search highlighter BooleanClause** getClauses(); /* DSR:PROPOSED: Give client code access to clauses.size() so we know how ** large the array returned by getClauses is. */ int_t getClauseCount(); float_t sumOfSquaredWeights(Searcher& searcher); void normalize(const float_t norm); Scorer* scorer(IndexReader& reader); // Prints a user-readable version of this query. const char_t* toString(const char_t* field); }; }} #endif