Lucene++ - a full-featured, c++ search engine
API Documentation


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
BooleanQuery.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2014 Alan Wright. All rights reserved.
3 // Distributable under the terms of either the Apache License (Version 2.0)
4 // or the GNU Lesser General Public License.
6 
7 #ifndef BOOLEANQUERY_H
8 #define BOOLEANQUERY_H
9 
10 #include "Query.h"
11 #include "BooleanClause.h"
12 #include "Weight.h"
13 
14 namespace Lucene {
15 
18 class LPPAPI BooleanQuery : public Query {
19 public:
27  BooleanQuery(bool disableCoord = false);
28  virtual ~BooleanQuery();
29 
31 
32 protected:
33  static int32_t maxClauseCount;
34 
38 
39 public:
40  using Query::toString;
41 
45  static int32_t getMaxClauseCount();
46 
48  static void setMaxClauseCount(int32_t maxClauseCount);
49 
52  bool isCoordDisabled();
53 
55  virtual SimilarityPtr getSimilarity(const SearcherPtr& searcher);
56 
66  void setMinimumNumberShouldMatch(int32_t min);
67 
69  int32_t getMinimumNumberShouldMatch();
70 
73  void add(const QueryPtr& query, BooleanClause::Occur occur);
74 
77  void add(const BooleanClausePtr& clause);
78 
80  Collection<BooleanClausePtr> getClauses();
81 
85 
86  virtual WeightPtr createWeight(const SearcherPtr& searcher);
87 
88  virtual QueryPtr rewrite(const IndexReaderPtr& reader);
89 
90  virtual void extractTerms(SetTerm terms);
91 
92  virtual LuceneObjectPtr clone(const LuceneObjectPtr& other = LuceneObjectPtr());
93  virtual String toString(const String& field);
94  virtual bool equals(const LuceneObjectPtr& other);
95  virtual int32_t hashCode();
96 
97  friend class BooleanWeight;
98 };
99 
100 }
101 
102 #endif
bool disableCoord
Definition: BooleanQuery.h:36
virtual String toString()
Prints a query to a string.
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition: LuceneTypes.h:539
boost::shared_ptr< Weight > WeightPtr
Definition: LuceneTypes.h:480
int32_t minNrShouldMatch
Definition: BooleanQuery.h:37
boost::shared_ptr< Searcher > SearcherPtr
Definition: LuceneTypes.h:434
boost::shared_ptr< BooleanClause > BooleanClausePtr
Definition: LuceneTypes.h:278
The abstract base class for queries.
Definition: Query.h:31
boost::shared_ptr< Query > QueryPtr
Definition: LuceneTypes.h:420
A Query that matches documents matching boolean combinations of other queries, eg. TermQuerys, PhraseQuerys or other BooleanQuerys.
Definition: BooleanQuery.h:18
boost::shared_ptr< IndexReader > IndexReaderPtr
Definition: LuceneTypes.h:157
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Definition: AbstractAllTermDocs.h:12
Occur
Specifies how clauses are to occur in matching documents.
Definition: BooleanClause.h:18
Collection< BooleanClausePtr > clauses
Definition: BooleanQuery.h:35
boost::shared_ptr< Similarity > SimilarityPtr
Definition: LuceneTypes.h:435

clucene.sourceforge.net