|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fr.gouv.culture.sdx.utils.AbstractSdxObject fr.gouv.culture.sdx.search.lucene.query.AbstractResponse fr.gouv.culture.sdx.search.lucene.query.Terms fr.gouv.culture.sdx.search.lucene.query.RegexTerms
public class RegexTerms
A list of terms for a document base filtered against a regular expression.
This class optimizes 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
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface fr.gouv.culture.sdx.utils.SdxObject |
---|
SdxObject.ConfigurationNode |
Field Summary |
---|
Fields inherited from class fr.gouv.culture.sdx.search.lucene.query.Terms |
---|
sortCollator, termList |
Fields inherited from class fr.gouv.culture.sdx.search.lucene.query.AbstractResponse |
---|
_count, _hitsPerPage, _nbPages, _searchLocations, HITS_PER_PAGE, HPP_ALL_HITS |
Fields inherited from class fr.gouv.culture.sdx.utils.AbstractSdxObject |
---|
_configuration, _context, _description, _encoding, _id, _locale, _logger, _manager, _xmlizable_objects, _xmlLang, isToSaxInitialized |
Fields inherited from interface fr.gouv.culture.sdx.search.Terms |
---|
CLASS_NAME_SUFFIX |
Fields inherited from interface fr.gouv.culture.sdx.utils.Encodable |
---|
DEFAULT_ENCODING |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class fr.gouv.culture.sdx.search.lucene.query.Terms |
---|
countPages, getClassNameSuffix, getDocumentSet, getList, getTerms, getTerms, getTerms, initCollator, setAllHits, setFieldFilter, setHitsPerPage, setUp, setUp, setUp, setUp, setUp, toSAX, toSAX |
Methods inherited from class fr.gouv.culture.sdx.search.lucene.query.AbstractResponse |
---|
count, getHitsPerPage, getNbPages, getSearchLocations, initToSax, initVolatileObjectsToSax, setNbPages |
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 |
Methods inherited from interface fr.gouv.culture.sdx.utils.Identifiable |
---|
getId, setId |
Methods inherited from interface fr.gouv.culture.sdx.utils.Describable |
---|
getDescription, setDescription |
Methods inherited from interface fr.gouv.culture.sdx.utils.Encodable |
---|
getEncoding, setEncoding |
Methods inherited from interface fr.gouv.culture.sdx.utils.Localizable |
---|
getLocale, getXmlLang, setLocale, setXmlLang |
Constructor Detail |
---|
public RegexTerms()
A super.getLog() must be set and then the Terms must be setUp.
AbstractSdxObject.enableLogging(org.apache.avalon.framework.logger.Logger)
,
setUp(fr.gouv.culture.sdx.search.lucene.query.SearchLocations, fr.gouv.culture.sdx.search.lucene.query.Results, java.lang.String, java.lang.String)
Method Detail |
---|
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 set
SDXException
public void setIndexReader(org.apache.lucene.index.IndexReader reader)
IndexReader
for this RegexTerms
reader
- 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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |