org.compass.core
Interface CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder

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

public static interface CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder
extends CompassQueryBuilder.ToCompassQuery

Parses the query string into terms, which all of them are used against the given resource property name / meta-data.

If the query string breaks into two terms (term1 and term2), and we use add(String) to add two resource property names: title and body, the query will be expanded to: (title:term1 body:term1) (title:term2 body:term2). If useAndDefaultOperator() is called, the query will be: +(title:term1 body:term1) +(title:term2 body:term2).

Author:
kimchy

Method Summary
 CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder add(String name)
          Adds another resource property name / meta-data that the query string will be executed against.
 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.
 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)).
 
Methods inherited from interface org.compass.core.CompassQueryBuilder.ToCompassQuery
toQuery
 

Method Detail

setAnalyzer

CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder setAnalyzer(String analyzer)
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).


setAnalyzerByAlias

CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder setAnalyzerByAlias(String alias)
                                                                              throws CompassException
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.

Throws:
CompassException

setQueryParser

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

Throws:
CompassException

add

CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder add(String name)
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)

Parameters:
name - The name of the resource property / meta-data.

useAndDefaultOperator

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)).



Copyright (c) 2004-2006 The Compass Project.