public class RegexTerms extends Terms
Terms
for the lists of terms filtered by a value
with or without wildcard. In this case, the class is 10th faster than Terms
.
This gain comes with the use of a RegexTermEnum
.SdxObject.ConfigurationNode
sortCollator, termList
_count, _hitsPerPage, _nbPages, _searchLocations, HITS_PER_PAGE, HPP_ALL_HITS
_configuration, _context, _description, _encoding, _id, _locale, _logger, _manager, _xmlizable_objects, _xmlLang, isToSaxInitialized
CLASS_NAME_SUFFIX
DEFAULT_ENCODING
Constructor and Description |
---|
RegexTerms()
Creates a list of terms according to a chain with truncation
A super.getLog() must be set and then the Terms must be setUp.
|
Modifier and Type | Method and Description |
---|---|
java.util.TreeMap |
getRegexTerms(java.util.BitSet docs)
Builds a list of terms (as a
TreeMap ). |
void |
setField(java.lang.String field)
Sets the field to this RegexTerms
|
void |
setIndexReader(org.apache.lucene.index.IndexReader reader)
Sets the
IndexReader for this RegexTerms |
void |
setRegex(java.lang.String value)
Sets the regular expression that may filter the list of terms
|
void |
setRegexCapabilities(org.apache.lucene.search.regex.RegexCapabilities regexCapabilities)
Sets the RegexCapabilities to this RegexTerms
Sets the RegexCapabilities to this RegexTerms.
|
void |
setSearchLocations(SearchLocations searchLocations)
Sets the SDX
SearchLocations to this RegexTerms
Sets the SDX SearchLocations to this RegexTerms. |
void |
setUp(SearchLocations sLocs,
Query sdxQuery,
java.lang.String field,
java.lang.String value)
Builds a term list filtered by a
Query , and optionally
a value. |
void |
setUp(SearchLocations sLocs,
org.apache.lucene.search.Query luceneQuery,
java.lang.String field,
java.lang.String value)
Builds a term list filtered by a Lucene
Query , and
optionally a value. |
void |
setUp(SearchLocations sLocs,
Query sdxQuery,
java.lang.String field,
java.lang.String value,
org.apache.lucene.search.regex.RegexCapabilities regexCapabilities)
Builds a term list filtered by a SDX
Query , and optionally
a value. |
void |
setUp(SearchLocations sLocs,
org.apache.lucene.search.Query luceneQuery,
java.lang.String field,
java.lang.String value,
org.apache.lucene.search.regex.RegexCapabilities regexCapabilities)
Builds a term list filtered by a Lucene
Query , and
optionally a value. |
void |
setUp(SearchLocations sLocs,
Results sdxResults,
java.lang.String field,
java.lang.String value)
Builds a term list filtered by a SDX
Results , and optionally
a value. |
void |
setUp(SearchLocations sLocs,
java.lang.String field,
java.lang.String value)
Builds a list of terms from a field, optionally filtered by a regular expression.
|
void |
setUp(SearchLocations sLocs,
java.lang.String field,
java.lang.String value,
org.apache.lucene.search.regex.RegexCapabilities regexCapabilities)
Builds a list of terms from a field, optionally filtered by a regular expression.
|
countPages, getClassNameSuffix, getDocumentSet, getList, getTerms, getTerms, getTerms, initCollator, setAllHits, setFieldFilter, setHitsPerPage, setUp, setUp, setUp, setUp, setUp, toSAX, toSAX
count, getHitsPerPage, getNbPages, getSearchLocations, initToSax, initVolatileObjectsToSax, setNbPages
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 RegexTerms()
A super.getLog() must be set and then the Terms must be setUp.
public void setRegexCapabilities(org.apache.lucene.search.regex.RegexCapabilities regexCapabilities)
Sets the RegexCapabilities to this RegexTerms. If the RegexCapabilities
passed to the method is null, uses JavaUtilRegexCapabilities
regexCapabilities
- The RegexCapabilities
to setpublic void setSearchLocations(SearchLocations searchLocations)
SearchLocations
to this RegexTerms
Sets the SDX SearchLocations
to this RegexTerms. Throws a warning message
when the SearchLocations
contains more than one Lucene Reader.setSearchLocations
in class AbstractResponse
searchLocations
- The SearchLocations
to set.AbstractResponse.setSearchLocations(fr.gouv.culture.sdx.search.lucene.query.SearchLocations)
public void setField(java.lang.String field) throws SDXException
field
- The field to setSDXException
public void setIndexReader(org.apache.lucene.index.IndexReader reader)
IndexReader
for this RegexTermsreader
- The IndexReader
to setpublic void setRegex(java.lang.String value) throws SDXException
value
- The regular expression (as a String
) to set.SDXException
- Throws a SDXException for incorrect regular expressionpublic void setUp(SearchLocations sLocs, Results sdxResults, java.lang.String field, java.lang.String value) throws SDXException
Results
, and optionally
a value.setUp
in class Terms
searchLocations
- The SDX Search Locations objectresults
- The Results object to extract the Lucene Queryfield
- The field name.value
- The value (may be null)SDXException
public void setUp(SearchLocations sLocs, Query sdxQuery, java.lang.String field, java.lang.String value) throws SDXException
Query
, and optionally
a value.setUp
in class Terms
searchLocations
- The SDX Search Locations objectsdxQuery
- The SDX Query object to extract the Lucene Queryfield
- The field name.value
- The value (may be null)SDXException
public void setUp(SearchLocations sLocs, Query sdxQuery, java.lang.String field, java.lang.String value, org.apache.lucene.search.regex.RegexCapabilities regexCapabilities) throws SDXException
Query
, and optionally
a value.searchLocations
- The SDX Search Locations object.sdxQuery
- The SDX Query
.field
- The field name.value
- The value (may be null).regexCapabilities
- The RegexCapabilities
.SDXException
public void setUp(SearchLocations sLocs, org.apache.lucene.search.Query luceneQuery, java.lang.String field, java.lang.String value) throws SDXException
Query
, and
optionally a value.setUp
in class Terms
searchLocations
- The SDX Search Locations object.query
- The Lucene Query objectfield
- The field name.value
- The value (may be null).SDXException
public void setUp(SearchLocations sLocs, org.apache.lucene.search.Query luceneQuery, java.lang.String field, java.lang.String value, org.apache.lucene.search.regex.RegexCapabilities regexCapabilities) throws SDXException
Query
, and
optionally a value.searchLocations
- The SDX Search Locations objectquery
- The Lucene Query
object.field
- The field name.value
- The value (may be null).regexCapabilities
- The RegexCapabilities
.SDXException
public void setUp(SearchLocations sLocs, java.lang.String field, java.lang.String value) throws SDXException
setUp
in class Terms
The
- SearchLocations
that indicates the document base to work on.The
- field (as a String
).The
- value (as a String
). Must be a valid regular expression. May be null or empty.SDXException
public void setUp(SearchLocations sLocs, java.lang.String field, java.lang.String value, org.apache.lucene.search.regex.RegexCapabilities regexCapabilities) throws SDXException
The
- SearchLocations
that indicates the document base to work on.The
- field (as a String
).The
- value (as a String
). Must be a valid regular expression. May be null or empty.The
- RegexCapabilities
to use with the RegexTermEnum
.SDXException
public java.util.TreeMap getRegexTerms(java.util.BitSet docs) throws SDXException
TreeMap
).docs
- The subset of documents (as a BitSet
).TreeMap
.SDXException
Copyright © 2000-2010 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.