public class DateIntervalQuery extends AbstractQuery
This query will only work on a Date field.
Two dates can be given : the first one gives the lower bound, the second one gives the upper bound. Bounds are inclusive NOT exclusive If only one of the two is not null, the query is unbounded. It is an error to give two null dates.
SdxObject.ConfigurationNode
Modifier and Type | Field and Description |
---|---|
protected boolean |
_inclusive |
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 |
---|
DateIntervalQuery()
Creates a query
A super.getLog() must be set and then this query must be setUp.
|
Modifier and Type | Method and Description |
---|---|
protected void |
setLuceneRangeQuery(java.lang.String fieldName,
java.lang.String lowerBound,
java.lang.String upperBound,
boolean inclusive) |
void |
setUp(SearchLocations sLocs,
java.lang.String fieldName,
java.util.Date beginDate,
java.util.Date endDate)
Buils a date interval query.
|
void |
setUp(SearchLocations sLocs,
java.lang.String fieldName,
java.util.Date beginDate,
java.util.Date endDate,
boolean inclusive)
Buils a date interval query.
|
void |
setUpOai(SearchLocations sLocs,
java.lang.String fieldName,
java.util.Date beginDate,
java.util.Date endDate)
Buils a date interval query for oai responses.
|
void |
toSAX(org.xml.sax.ContentHandler hdl)
Returns a SAX representation of this query.
|
addAttributesLucene, addAttributesText, addBaseQuery, addBaseQuery, addFilter, addSortSpecification, execute, getBoost, getCachedQuery, getClassNameSuffix, getLuceneQuery, getOperator, getSearchLocations, initToSax, initVolatileObjectsToSax, prepare, setBoost, 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 DateIntervalQuery()
A super.getLog() must be set and then this query must be setUp.
public void setUpOai(SearchLocations sLocs, java.lang.String fieldName, java.util.Date beginDate, java.util.Date endDate) throws SDXException
One of beginDate or endDate must be non null.
sLocs
- The SearchLocations object (indices to be searched).fieldName
- The field name to search (if null or non existent, default field will be searched).beginDate
- The lower bound date (may be null).endDate
- The upper bound date (may be null).SDXException
public void setUp(SearchLocations sLocs, java.lang.String fieldName, java.util.Date beginDate, java.util.Date endDate) throws SDXException
One of beginDate or endDate must be non null.
sLocs
- The SearchLocations object (indices to be searched).fieldName
- The field name to search (if null or non existent, default field will be searched).beginDate
- The lower bound date (may be null).endDate
- The upper bound date (may be null).SDXException
public void setUp(SearchLocations sLocs, java.lang.String fieldName, java.util.Date beginDate, java.util.Date endDate, boolean inclusive) throws SDXException
One of beginDate or endDate must be non null.
sLocs
- The SearchLocations object (indices to be searched).fieldName
- The field name to search (if null or non existent, default field will be searched).beginDate
- The lower bound date (may be null).endDate
- The upper bound date (may be null).inclusive
- Whether the bounds should be included in the requestSDXException
protected void setLuceneRangeQuery(java.lang.String fieldName, java.lang.String lowerBound, java.lang.String upperBound, boolean inclusive)
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 ContentHandler that will receive the events.org.xml.sax.SAXException
Copyright © 2000-2010 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.