public class BooleanQuery extends Query implements <BooleanClause>
TermQuery
s, PhraseQuery
s or other
BooleanQuerys.Modifier and Type | Class and Description |
---|---|
static class |
BooleanQuery.Builder
A builder for boolean queries.
|
static class |
BooleanQuery.TooManyClauses
Thrown when an attempt is made to add more than
getMaxClauseCount() clauses. |
Modifier and Type | Method and Description |
---|---|
<BooleanClause> |
clauses()
Return a list of the clauses of this
BooleanQuery . |
Weight |
createWeight(IndexSearcher searcher,
ScoreMode scoreMode,
float boost)
Expert: Constructs an appropriate Weight implementation for this query.
|
boolean |
o)
Compares the specified object with this boolean query for equality.
|
static int |
getMaxClauseCount()
Return the maximum number of clauses permitted, 1024 by default.
|
int |
getMinimumNumberShouldMatch()
Gets the minimum number of the optional BooleanClauses
which must be satisfied.
|
int |
hashCode()
Override and implement query hash code properly in a subclass.
|
<BooleanClause> |
iterator()
Returns an iterator on the clauses in this query.
|
Query |
rewrite(IndexReader reader)
Expert: called to re-write queries into primitive queries.
|
static void |
setMaxClauseCount(int maxClauseCount)
Set the maximum number of clauses permitted per BooleanQuery.
|
|
field)
Prints a user-readable version of this query.
|
void |
visit(QueryVisitor visitor)
Recurse through the query tree, visiting any child queries
|
classHash, sameClassAs, toString
public static int getMaxClauseCount()
BooleanQuery.TooManyClauses
to be thrown.setMaxClauseCount(int)
public static void setMaxClauseCount(int maxClauseCount)
public int getMinimumNumberShouldMatch()
public <BooleanClause> clauses()
BooleanQuery
.public final <BooleanClause> iterator()
for (BooleanClause clause : booleanQuery) {}
in interface <BooleanClause>
public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws
Query
Only implemented by primitive queries, which re-write to themselves.
createWeight
in class Query
scoreMode
- How the produced scorers will be consumed.boost
- The boost that is propagated by the parent queries.
public Query rewrite(IndexReader reader) throws
Query
public void visit(QueryVisitor visitor)
Query
public toString( field)
public boolean equals( o)
BooleanQuery
,getMinimumNumberShouldMatch()
BooleanClause.Occur.SHOULD
clauses, regardless of the orderBooleanClause.Occur.MUST
clauses, regardless of the orderBooleanClause.Occur.FILTER
clauses, regardless of the
order and regardless of duplicatesBooleanClause.Occur.MUST_NOT
clauses, regardless of
the order and regardless of duplicatesequals
in class Query
Query.sameClassAs(Object)
,
Query.classHash()
public int hashCode()
Query
QueryCache
works properly.hashCode
in class Query
Query.equals(Object)
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.