public class ComplexQuery extends AbstractQuery
Any boolean query can be represented by a complex query. It is made of search criterias linked with a boolean operator. All criterias are themselves any type of Lucene query, so the model is recursive.
SdxObject.ConfigurationNodebaseOperator, baseQuery, baseResults, cachedQuery, filter, luceneQuery, queryText, searchLocations, sortSpecification_configuration, _context, _description, _encoding, _id, _locale, _logger, _manager, _xmlizable_objects, _xmlLang, isToSaxInitializeddefaultOperator, LUCENE_BOOLEAN_QUERY_MAX_CLAUSES, OPERATOR_AND, OPERATOR_NOT, OPERATOR_OR, SEARCH_ENGINECLASS_NAME_SUFFIXDEFAULT_ENCODING| Constructor and Description |
|---|
ComplexQuery()
Creates a query
A super.getLog() must be set and then this query must be setUp.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addComponent(Query component)
Adds a component to this query.
|
float |
getBoost()
Returns the boost on the query.
|
Filter |
prepare()
Prepares the query to make it executable.
|
protected Query |
removeLastComponent()
Removes the last component added from the list of components, and returns it.
|
void |
setBoost(float boost)
Change the boost on the query.
|
void |
setUp(SearchLocations sLocs,
int operator)
Builds a complex query for an index using an operator.
|
int |
size()
Returns the number of components for this query.
|
void |
toSAX(org.xml.sax.ContentHandler hdl)
Returns a SAX representation of this query..
|
addAttributesLucene, addAttributesText, addBaseQuery, addBaseQuery, addFilter, addSortSpecification, execute, getCachedQuery, getClassNameSuffix, getLuceneQuery, getOperator, getSearchLocations, initToSax, initVolatileObjectsToSax, setBoost, setLuceneQuery, setSearchLocations, setUp, setUpconfigure, configureDescription, contextualize, enableLogging, getBaseAttributes, getConfiguration, getContext, getDescription, getEncoding, getId, getLocale, getLog, getServiceManager, getXmlLang, service, setDescription, setEncoding, setId, setLocale, setUpSdxObject, setUpSdxObject, setXmlLang, verifyConfigurationResourcesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetId, setIdgetDescription, setDescriptiongetEncoding, setEncodinggetLocale, getXmlLang, setLocale, setXmlLangpublic ComplexQuery()
A super.getLog() must be set and then this query must be setUp.
public void setBoost(float boost)
QueryThis method changes the boost on the query to make it more significant.
setBoost in class AbstractQuerypublic float getBoost()
QueryThis method returns the boost on the query.
getBoost in class AbstractQuerypublic void setUp(SearchLocations sLocs, int operator) throws SDXException
sLocs - The SearchLocations object (indices to be searched).operator - The operator linking the components.SDXExceptionpublic Filter prepare()
This method will basically call the prepare methods of its components and merge the filters.
prepare in class AbstractQuerypublic void addComponent(Query component)
component - The component to add.public int size()
public void toSAX(org.xml.sax.ContentHandler hdl)
throws org.xml.sax.SAXException
toSAX in interface org.apache.excalibur.xml.sax.XMLizabletoSAX in class AbstractQueryhdl - The content handler that will receive the events.org.xml.sax.SAXExceptionprotected Query removeLastComponent()
Copyright © 2000-2010 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.