org.compass.core.impl
Class DefaultCompassQueryBuilder.DefaultCompassMultiPropertyQueryStringBuilder

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

public class DefaultCompassQueryBuilder.DefaultCompassMultiPropertyQueryStringBuilder
extends Object
implements CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder


Constructor Summary
DefaultCompassQueryBuilder.DefaultCompassMultiPropertyQueryStringBuilder(SearchEngineQueryBuilder.SearchEngineMultiPropertyQueryStringBuilder queryBuilder, InternalCompassSession session)
           
 
Method Summary
 CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder add(String name)
          Adds another resource property name / meta-data that the query string will be executed against.
 CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder forceAnalyzer()
          Forces the query parser to use the analyzer specified or confiugred and not analyzers that might be defined on different mappings.
 CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder setAnalyzer(String analyzer)
          Sets the analyzer that will be used to analyze the query string.
 CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder setAnalyzerByAlias(String alias)
          Sets the analyzer that will be used to analyzer the query string.
 CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder setQueryParser(String queryParser)
          Sets te query parser lookup name that will be used to parse the query string.
 CompassQuery toQuery()
          Create the query.
 CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder useAndDefaultOperator()
          If called, the query will be expanded to: +(title:term1 body:term1) +(title:term2 body:term2) (Instead of (title:term1 body:term1) (title:term2 body:term2)).
 CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder useOrDefaultOperator()
          Uses the OR operator as the default operator instead of AND operator.
 CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder useSpellCheck()
          Uses the spell check for suggesting a query based on the query string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCompassQueryBuilder.DefaultCompassMultiPropertyQueryStringBuilder

public DefaultCompassQueryBuilder.DefaultCompassMultiPropertyQueryStringBuilder(SearchEngineQueryBuilder.SearchEngineMultiPropertyQueryStringBuilder queryBuilder,
                                                                                InternalCompassSession session)
Method Detail

setAnalyzer

public CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder setAnalyzer(String analyzer)
                                                                       throws CompassException
Description copied from interface: CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder
Sets the analyzer that will be used to analyze the query string. Can be null. It is used when parsing a query string and has no effect when using a bulit in query (using the CompassQuery).

Specified by:
setAnalyzer in interface CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder
Throws:
CompassException

setAnalyzerByAlias

public CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder setAnalyzerByAlias(String alias)
                                                                              throws CompassException
Description copied from interface: CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder
Sets the analyzer that will be used to analyzer the query string. The analyzer will be build based on analyzer settings for the mapping definitions the define the alias. It means that if a certain property is associated with a specific analyzer, a per property analyzer will be built.

Specified by:
setAnalyzerByAlias in interface CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder
Throws:
CompassException

setQueryParser

public CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder setQueryParser(String queryParser)
                                                                          throws CompassException
Description copied from interface: CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder
Sets te query parser lookup name that will be used to parse the query string.

Specified by:
setQueryParser in interface CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder
Throws:
CompassException

useSpellCheck

public CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder useSpellCheck()
Description copied from interface: CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder
Uses the spell check for suggesting a query based on the query string.

Specified by:
useSpellCheck in interface CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder

add

public CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder add(String name)
Description copied from interface: CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder
Adds another resource property name / meta-data that the query string will be executed against.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)

Specified by:
add in interface CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder
Parameters:
name - The name of the resource property / meta-data.

useAndDefaultOperator

public CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder useAndDefaultOperator()
Description copied from interface: CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder
If called, the query will be expanded to: +(title:term1 body:term1) +(title:term2 body:term2) (Instead of (title:term1 body:term1) (title:term2 body:term2)).

Specified by:
useAndDefaultOperator in interface CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder

useOrDefaultOperator

public CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder useOrDefaultOperator()
Description copied from interface: CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder
Uses the OR operator as the default operator instead of AND operator.

Specified by:
useOrDefaultOperator in interface CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder

forceAnalyzer

public CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder forceAnalyzer()
Description copied from interface: CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder
Forces the query parser to use the analyzer specified or confiugred and not analyzers that might be defined on different mappings.

Specified by:
forceAnalyzer in interface CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder

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.