org.compass.core
Interface CompassQueryBuilder.CompassQueryStringBuilder

All Superinterfaces:
CompassQueryBuilder.ToCompassQuery
All Known Implementing Classes:
DefaultCompassQueryBuilder.DefaultCompassQueryStringBuilder
Enclosing interface:
CompassQueryBuilder

public static interface CompassQueryBuilder.CompassQueryStringBuilder
extends CompassQueryBuilder.ToCompassQuery

A query builder used to construct a query from a query string (i.e. +jack +fang). The analyzer that will be used to analyze the query string and the default search property (for search terms not prefixed with a property name) can be set before calling the toQuery.

Author:
kimchy

Method Summary
 CompassQueryBuilder.CompassQueryStringBuilder forceAnalyzer()
          Forces the query string to only use the analyzer specificed (or configured) and not take into account any analyzers that might be specifiec within the mappings.
 CompassQueryBuilder.CompassQueryStringBuilder setAnalyzer(String analyzer)
          Sets the analyzer that will be used to analyze the query string.
 CompassQueryBuilder.CompassQueryStringBuilder setAnalyzerByAlias(String alias)
          Sets the analyzer that will be used to analyzer the query string.
 CompassQueryBuilder.CompassQueryStringBuilder setDefaultSearchProperty(String defaultSearchProperty)
          Sets the default search property for non prefixed terms in the query string.
 CompassQueryBuilder.CompassQueryStringBuilder setQueryParser(String queryParser)
          Sets te query parser lookup name that will be used to parse the query string.
 CompassQueryBuilder.CompassQueryStringBuilder useAndDefaultOperator()
          Uses the and operator as the default operator instead of OR operator.
 CompassQueryBuilder.CompassQueryStringBuilder useOrDefaultOperator()
          Uses the OR operator as the default operator instead of AND operator.
 CompassQueryBuilder.CompassQueryStringBuilder useSpellCheck()
          Uses the spell check for suggesting a query based on the query string.
 
Methods inherited from interface org.compass.core.CompassQueryBuilder.ToCompassQuery
toQuery
 

Method Detail

setAnalyzer

CompassQueryBuilder.CompassQueryStringBuilder setAnalyzer(String analyzer)
                                                          throws CompassException
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).

Throws:
CompassException

setQueryParser

CompassQueryBuilder.CompassQueryStringBuilder setQueryParser(String queryParser)
                                                             throws CompassException
Sets te query parser lookup name that will be used to parse the query string.

Throws:
CompassException

useSpellCheck

CompassQueryBuilder.CompassQueryStringBuilder useSpellCheck()
                                                            throws CompassException
Uses the spell check for suggesting a query based on the query string.

Throws:
CompassException

setAnalyzerByAlias

CompassQueryBuilder.CompassQueryStringBuilder setAnalyzerByAlias(String alias)
                                                                 throws CompassException
Sets the analyzer that will be used to analyzer the query string. The analyzer will be built 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.

Throws:
CompassException

setDefaultSearchProperty

CompassQueryBuilder.CompassQueryStringBuilder setDefaultSearchProperty(String defaultSearchProperty)
Sets the default search property for non prefixed terms in 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).


useAndDefaultOperator

CompassQueryBuilder.CompassQueryStringBuilder useAndDefaultOperator()
Uses the and operator as the default operator instead of OR operator.


useOrDefaultOperator

CompassQueryBuilder.CompassQueryStringBuilder useOrDefaultOperator()
Uses the OR operator as the default operator instead of AND operator.


forceAnalyzer

CompassQueryBuilder.CompassQueryStringBuilder forceAnalyzer()
Forces the query string to only use the analyzer specificed (or configured) and not take into account any analyzers that might be specifiec within the mappings.



Copyright (c) 2004-2008 The Compass Project.