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

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- File List
- Globals

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-2011 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 {
20 public:
28 BooleanQuery(bool disableCoord = false);
29 virtual ~BooleanQuery();
30
31 LUCENE_CLASS(BooleanQuery);
32
33 protected:
34 static int32_t maxClauseCount;
35
36 Collection<BooleanClausePtr> clauses;
37 bool disableCoord;
38 int32_t minNrShouldMatch;
39
40 public:
41 using Query::toString;
42
46 static int32_t getMaxClauseCount();
47
49 static void setMaxClauseCount(int32_t maxClauseCount);
50
53 bool isCoordDisabled();
54
56 virtual SimilarityPtr getSimilarity(SearcherPtr searcher);
57
67 void setMinimumNumberShouldMatch(int32_t min);
68
70 int32_t getMinimumNumberShouldMatch();
71
74 void add(QueryPtr query, BooleanClause::Occur occur);
75
78 void add(BooleanClausePtr clause);
79
81 Collection<BooleanClausePtr> getClauses();
82
84 Collection<BooleanClausePtr>::iterator begin();
85 Collection<BooleanClausePtr>::iterator end();
86
87 virtual WeightPtr createWeight(SearcherPtr searcher);
88
89 virtual QueryPtr rewrite(IndexReaderPtr reader);
90
91 virtual void extractTerms(SetTerm terms);
92
93 virtual LuceneObjectPtr clone(LuceneObjectPtr other = LuceneObjectPtr());
94 virtual String toString(const String& field);
95 virtual bool equals(LuceneObjectPtr other);
96 virtual int32_t hashCode();
97
98 friend class BooleanWeight;
99 };
100 }
101
102 #endif

clucene.sourceforge.net