org.compass.core.impl
Class DefaultCompassQueryBuilder.DefaultCompassBooleanQueryBuilder

java.lang.Object
  extended by org.compass.core.impl.DefaultCompassQueryBuilder.DefaultCompassBooleanQueryBuilder
All Implemented Interfaces:
CompassQueryBuilder.CompassBooleanQueryBuilder, CompassQueryBuilder.ToCompassQuery
Enclosing class:
DefaultCompassQueryBuilder

public class DefaultCompassQueryBuilder.DefaultCompassBooleanQueryBuilder
extends Object
implements CompassQueryBuilder.CompassBooleanQueryBuilder


Constructor Summary
DefaultCompassQueryBuilder.DefaultCompassBooleanQueryBuilder(SearchEngineQueryBuilder.SearchEngineBooleanQueryBuilder queryBuilder, InternalCompassSession session)
           
 
Method Summary
 CompassQueryBuilder.CompassBooleanQueryBuilder addMust(CompassQuery query)
          Hits must match the given query.
 CompassQueryBuilder.CompassBooleanQueryBuilder addMustNot(CompassQuery query)
          Hits must not match the given query.
 CompassQueryBuilder.CompassBooleanQueryBuilder addShould(CompassQuery query)
          Hits should match the given query.
 CompassQueryBuilder.CompassBooleanQueryBuilder setMinimumNumberShouldMatch(int min)
          Specifies a minimum number of the optional BooleanClauses which must be satisfied.
 CompassQuery toQuery()
          Create the query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCompassQueryBuilder.DefaultCompassBooleanQueryBuilder

public DefaultCompassQueryBuilder.DefaultCompassBooleanQueryBuilder(SearchEngineQueryBuilder.SearchEngineBooleanQueryBuilder queryBuilder,
                                                                    InternalCompassSession session)
Method Detail

addMust

public CompassQueryBuilder.CompassBooleanQueryBuilder addMust(CompassQuery query)
Description copied from interface: CompassQueryBuilder.CompassBooleanQueryBuilder
Hits must match the given query.

Specified by:
addMust in interface CompassQueryBuilder.CompassBooleanQueryBuilder
Parameters:
query - The query to add
Returns:
The current builder

addMustNot

public CompassQueryBuilder.CompassBooleanQueryBuilder addMustNot(CompassQuery query)
Description copied from interface: CompassQueryBuilder.CompassBooleanQueryBuilder
Hits must not match the given query. Note that it is not possible to build a boolean query that only consists of must not queries.

Specified by:
addMustNot in interface CompassQueryBuilder.CompassBooleanQueryBuilder
Parameters:
query - The query to add
Returns:
The current builder

addShould

public CompassQueryBuilder.CompassBooleanQueryBuilder addShould(CompassQuery query)
Description copied from interface: CompassQueryBuilder.CompassBooleanQueryBuilder
Hits should match the given query. For a boolean build query with two should subqueries, at least one of the queries must appear in the matching hits.

Specified by:
addShould in interface CompassQueryBuilder.CompassBooleanQueryBuilder
Parameters:
query - The query to add
Returns:
The current builder

setMinimumNumberShouldMatch

public CompassQueryBuilder.CompassBooleanQueryBuilder setMinimumNumberShouldMatch(int min)
Description copied from interface: CompassQueryBuilder.CompassBooleanQueryBuilder
Specifies a minimum number of the optional BooleanClauses which must be satisfied.

By default no optional clauses are necessary for a match (unless there are no required clauses). If this method is used, then the specified number of clauses is required.

Use of this method is totally independent of specifying that any specific clauses are required (or prohibited). This number will only be compared against the number of matching optional clauses.

EXPERT NOTE: Using this method may force collecting docs in order, regardless of whether setAllowDocsOutOfOrder(true) has been called.

Specified by:
setMinimumNumberShouldMatch in interface CompassQueryBuilder.CompassBooleanQueryBuilder

toQuery

public CompassQuery toQuery()
Description copied from interface: CompassQueryBuilder.ToCompassQuery
Create the query.

Specified by:
toQuery in interface CompassQueryBuilder.ToCompassQuery


Copyright (c) 2004-2008 The Compass Project.