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 org.apache.lucene.search.Query
getBoost, setBoost
 
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


Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.