java.lang.Object | ||
↳ | org.apache.lucene.search.Query | |
↳ | org.apache.lucene.search.BooleanQuery |
A Query that matches documents matching boolean combinations of other
queries, e.g. TermQuery
s, PhraseQuery
s or other
BooleanQuerys.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
BooleanQuery.BooleanWeight | Expert: the Weight for BooleanQuery, used to normalize, score and explain these queries. | ||||||||||
BooleanQuery.TooManyClauses | Thrown when an attempt is made to add more than getMaxClauseCount() clauses. |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
minNrShouldMatch |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an empty boolean query.
| |||||||||||
Constructs an empty boolean query.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a clause to a boolean query.
| |||||||||||
Adds a clause to a boolean query.
| |||||||||||
Returns the list of clauses in this query.
| |||||||||||
Returns a clone of this query.
| |||||||||||
Expert: Constructs an appropriate Weight implementation for this query.
| |||||||||||
Returns true iff
o is equal to this. | |||||||||||
Expert: adds all terms occurring in this query to the terms set.
| |||||||||||
Returns the set of clauses in this query.
| |||||||||||
Return the maximum number of clauses permitted, 1024 by default.
| |||||||||||
Gets the minimum number of the optional BooleanClauses
which must be satisfied.
| |||||||||||
Expert: Returns the Similarity implementation to be used for this query.
| |||||||||||
Returns a hash code value for this object.
| |||||||||||
Returns true iff
coord(int, int) is disabled in
scoring for this query instance. | |||||||||||
Returns an iterator on the clauses in this query.
| |||||||||||
Expert: called to re-write queries into primitive queries.
| |||||||||||
Set the maximum number of clauses permitted per BooleanQuery.
| |||||||||||
Specifies a minimum number of the optional BooleanClauses
which must be satisfied.
| |||||||||||
Prints a user-readable version of this query.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.lucene.search.Query
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
java.lang.Iterable
|
Constructs an empty boolean query.
Constructs an empty boolean query.
coord(int, int)
may be disabled in scoring, as
appropriate. For example, this score factor does not make sense for most
automatically generated queries, like WildcardQuery
and FuzzyQuery
.
disableCoord | disables coord(int, int) in scoring.
|
---|
Adds a clause to a boolean query.
BooleanQuery.TooManyClauses | if the new number of clauses exceeds the maximum clause number |
---|
Adds a clause to a boolean query.
BooleanQuery.TooManyClauses | if the new number of clauses exceeds the maximum clause number |
---|
Expert: Constructs an appropriate Weight implementation for this query.
Only implemented by primitive queries, which re-write to themselves.
IOException |
---|
Expert: adds all terms occurring in this query to the terms set. Only
works if this query is in its rewritten
form.
Return the maximum number of clauses permitted, 1024 by default.
Attempts to add more than the permitted number of clauses cause BooleanQuery.TooManyClauses
to be thrown.
Gets the minimum number of the optional BooleanClauses which must be satisfied.
Expert: Returns the Similarity implementation to be used for this query. Subclasses may override this method to specify their own Similarity implementation, perhaps one that delegates through that of the Searcher. By default the Searcher's Similarity implementation is returned.
Returns a hash code value for this object.
Returns true iff coord(int, int)
is disabled in
scoring for this query instance.
Returns an iterator on the clauses in this query. It implements the Iterable
interface to
make it possible to do:
for (BooleanClause clause : booleanQuery) {}
Expert: called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into a BooleanQuery that consists of TermQuerys.
IOException |
---|
Set the maximum number of clauses permitted per BooleanQuery. Default value is 1024.
Specifies a minimum number of the optional BooleanClauses which must be satisfied.
By default no optional clauses are necessary for a match (unless there are no required clauses). If this method is used, then the specified number of clauses is required.
Use of this method is totally independent of specifying that any specific clauses are required (or prohibited). This number will only be compared against the number of matching optional clauses.
min | the number of optional clauses that must match |
---|