org.apache.lucene.search
Class BooleanQuery
java.lang.Object
|
+--org.apache.lucene.search.Query
|
+--org.apache.lucene.search.BooleanQuery
- All Implemented Interfaces:
- Serializable
- public final class BooleanQuery
- extends Query
A Query that matches documents matching boolean combinations of other
queries, typically TermQuerys or PhraseQuerys.
- See Also:
- Serialized Form
| Fields inherited from class org.apache.lucene.search.Query |
boost |
|
Constructor Summary |
BooleanQuery()
Constructs an empty boolean query. |
|
Method Summary |
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. |
String |
toString(String field)
Prints a user-readable version of this query. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BooleanQuery
public BooleanQuery()
- Constructs an empty boolean query.
add
public final void add(Query query,
boolean required,
boolean prohibited)
- Adds a clause to a boolean query. Clauses may be:
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
- neither, in which case matched documents are neither prohibited from
nor required to match the sub-query.
It is an error to specify a clause as both required and
prohibited.
add
public final void add(BooleanClause clause)
- Adds a clause to a boolean query.
toString
public String toString(String field)
- Prints a user-readable version of this query.
- Overrides:
toString in class Query
Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.