com.lucene.search
Class BooleanQuery

java.lang.Object
  |
  +--com.lucene.search.Query
        |
        +--com.lucene.search.BooleanQuery

public final class BooleanQuery
extends Query

A Query that matches documents matching boolean combinations of other queries, typically TermQuerys or PhraseQuerys.


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
 

Constructor Detail

BooleanQuery

public BooleanQuery()
Constructs an empty boolean query.
Method Detail

add

public final void add(Query query,
                      boolean required,
                      boolean prohibited)
Adds a clause to a boolean query. Clauses may be: 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