public class BooleanQuery extends Query
TermQuery
s or PhraseQuery
s.Modifier and Type | Class and Description |
---|---|
static class |
BooleanQuery.TooManyClauses
Thrown when an attempt is made to add more than
getMaxClauseCount() clauses. |
Modifier and Type | Field and Description |
---|---|
static int |
maxClauseCount
Default value is 1024.
|
Constructor and Description |
---|
BooleanQuery()
Constructs an empty boolean query.
|
Modifier and Type | Method and Description |
---|---|
void |
add(BooleanClause clause)
Adds a clause to a boolean query.
|
void |
add(Query query,
boolean required,
boolean prohibited)
Adds a clause to a boolean query.
|
Object |
clone()
Returns a clone of this query.
|
protected Weight |
createWeight(Searcher searcher)
Expert: Constructs an appropriate Weight implementation for this query.
|
boolean |
equals(Object o)
Returns true iff
o is equal to this. |
BooleanClause[] |
getClauses()
Returns the set of clauses in this query.
|
static int |
getMaxClauseCount()
Return the maximum number of clauses permitted, 1024 by default.
|
int |
hashCode()
Returns a hash code value for this object.
|
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.
|
String |
toString(String field)
Prints a user-readable version of this query.
|
combine, getBoost, getSimilarity, mergeBooleanQueries, setBoost, toString, weight
public static int maxClauseCount
gate.creole.annic.apache.lucene.maxClauseCount
system property to override.public static int getMaxClauseCount()
BooleanQuery.TooManyClauses
to be thrown.public static void setMaxClauseCount(int maxClauseCount)
public void add(Query query, boolean required, boolean prohibited)
required
which means that documents which do not
match this sub-query will not match the boolean query;
prohibited
which means that documents which do
match this sub-query will not match the boolean query; or
required
and
prohibited
.getMaxClauseCount()
public void add(BooleanClause clause)
getMaxClauseCount()
public BooleanClause[] getClauses()
protected Weight createWeight(Searcher searcher)
Query
Only implemented by primitive queries, which re-write to themselves.
createWeight
in class Query
public Query rewrite(IndexReader reader) throws IOException
Query
rewrite
in class Query
IOException
public boolean equals(Object o)
o
is equal to this.Copyright © 2024 GATE. All rights reserved.