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.ConfigurationNode
baseOperator, baseQuery, baseResults, cachedQuery, filter, luceneQuery, queryText, searchLocations, sortSpecification
_configuration, _context, _description, _encoding, _id, _locale, _logger, _manager, _xmlizable_objects, _xmlLang, isToSaxInitialized
defaultOperator, LUCENE_BOOLEAN_QUERY_MAX_CLAUSES, OPERATOR_AND, OPERATOR_NOT, OPERATOR_OR, SEARCH_ENGINE
CLASS_NAME_SUFFIX
DEFAULT_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, setUp
configure, configureDescription, contextualize, enableLogging, getBaseAttributes, getConfiguration, getContext, getDescription, getEncoding, getId, getLocale, getLog, getServiceManager, getXmlLang, service, setDescription, setEncoding, setId, setLocale, setUpSdxObject, setUpSdxObject, setXmlLang, verifyConfigurationResources
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getId, setId
getDescription, setDescription
getEncoding, setEncoding
getLocale, getXmlLang, setLocale, setXmlLang
public ComplexQuery()
A super.getLog() must be set and then this query must be setUp.
public void setBoost(float boost)
Query
This method changes the boost on the query to make it more significant.
setBoost
in class AbstractQuery
public float getBoost()
Query
This method returns the boost on the query.
getBoost
in class AbstractQuery
public void setUp(SearchLocations sLocs, int operator) throws SDXException
sLocs
- The SearchLocations object (indices to be searched).operator
- The operator linking the components.SDXException
public Filter prepare()
This method will basically call the prepare methods of its components and merge the filters.
prepare
in class AbstractQuery
public 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.XMLizable
toSAX
in class AbstractQuery
hdl
- The content handler that will receive the events.org.xml.sax.SAXException
protected Query removeLastComponent()
Copyright © 2000-2010 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.