fr.gouv.culture.sdx.search.lucene.query
Class SimpleQuery
java.lang.Object
fr.gouv.culture.sdx.utils.AbstractSdxObject
fr.gouv.culture.sdx.search.lucene.query.AbstractQuery
fr.gouv.culture.sdx.search.lucene.query.SimpleQuery
- All Implemented Interfaces:
- Query, Describable, Encodable, Identifiable, Localizable, SdxObject, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, org.apache.excalibur.xml.sax.XMLizable
- Direct Known Subclasses:
- RestrictedQuery
public class SimpleQuery
- extends AbstractQuery
A simple query.
A simple query is passed directly to Lucene. It is supposed to use the Lucene query syntax.
Fields inherited from class fr.gouv.culture.sdx.utils.AbstractSdxObject |
_configuration, _context, _description, _encoding, _id, _locale, _logger, _manager, _xmlizable_objects, _xmlLang, isToSaxInitialized |
Constructor Summary |
SimpleQuery()
Creates a query
A super.getLog() must be set and then this query must be setUp. |
Method Summary |
void |
setUp(SearchLocations sLocs,
java.lang.String defaultField,
java.lang.String q)
Builds a simple query. |
void |
setUp(SearchLocations sLocs,
java.lang.String defaultField,
java.lang.String q,
int operator)
Builds a simple query. |
void |
toSAX(org.xml.sax.ContentHandler hdl)
Returns a SAX representation of this query. |
Methods inherited from class fr.gouv.culture.sdx.search.lucene.query.AbstractQuery |
addAttributesLucene, addAttributesText, addBaseQuery, addBaseQuery, addFilter, addSortSpecification, execute, getBoost, getCachedQuery, getClassNameSuffix, getLuceneQuery, getOperator, getSearchLocations, initToSax, initVolatileObjectsToSax, prepare, setBoost, setBoost, setLuceneQuery, setSearchLocations, setUp, setUp |
Methods inherited from class fr.gouv.culture.sdx.utils.AbstractSdxObject |
configure, configureDescription, contextualize, enableLogging, getBaseAttributes, getConfiguration, getContext, getDescription, getEncoding, getId, getLocale, getLog, getServiceManager, getXmlLang, service, setDescription, setEncoding, setId, setLocale, setUpSdxObject, setUpSdxObject, setXmlLang, verifyConfigurationResources |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface fr.gouv.culture.sdx.utils.SdxObject |
getLog |
Methods inherited from interface org.apache.avalon.framework.logger.LogEnabled |
enableLogging |
Methods inherited from interface org.apache.avalon.framework.context.Contextualizable |
contextualize |
Methods inherited from interface org.apache.avalon.framework.service.Serviceable |
service |
Methods inherited from interface org.apache.avalon.framework.configuration.Configurable |
configure |
SimpleQuery
public SimpleQuery()
- Creates a query
A super.getLog() must be set and then this query must be setUp.
- See Also:
AbstractSdxObject.enableLogging(org.apache.avalon.framework.logger.Logger)
,
setUp(fr.gouv.culture.sdx.search.lucene.query.SearchLocations, java.lang.String, java.lang.String)
setUp
public void setUp(SearchLocations sLocs,
java.lang.String defaultField,
java.lang.String q)
throws SDXException
- Builds a simple query.
- Parameters:
sLocs
- The SearchLocations object (indices to be searched).q
- The query string.
- Throws:
SDXException
setUp
public void setUp(SearchLocations sLocs,
java.lang.String defaultField,
java.lang.String q,
int operator)
throws SDXException
- Builds a simple query.
- Parameters:
sLocs
- The SearchLocations object (indices to be searched).q
- The query string.operator
- The operator for the query (ie AND or OR).
- Throws:
SDXException
- See Also:
QueryParser.DEFAULT_OPERATOR
,
QueryParser.OPERATOR_AND
,
QueryParser.OPERATOR_OR
toSAX
public void toSAX(org.xml.sax.ContentHandler hdl)
throws org.xml.sax.SAXException
- Returns a SAX representation of this query.
- Specified by:
toSAX
in interface org.apache.excalibur.xml.sax.XMLizable
- Specified by:
toSAX
in class AbstractQuery
- Parameters:
hdl
- The ContentHandler to feed with events.
- Throws:
org.xml.sax.SAXException
Copyright © 2000-2010 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.