Package org.apache.lucene.search
Class MultiTermQueryWrapperFilter<Q extends MultiTermQuery>
java.lang.Object
org.apache.lucene.search.Filter
org.apache.lucene.search.MultiTermQueryWrapperFilter<Q>
- Direct Known Subclasses:
NumericRangeFilter,PrefixFilter,TermRangeFilter
A wrapper for
MultiTermQuery, that exposes its
functionality as a Filter.
MultiTermQueryWrapperFilter is not designed to
be used by itself. Normally you subclass it to provide a Filter
counterpart for a MultiTermQuery subclass.
For example, TermRangeFilter and PrefixFilter extend
MultiTermQueryWrapperFilter.
This class also provides the functionality behind
MultiTermQuery.CONSTANT_SCORE_FILTER_REWRITE;
this is why it is not abstract.
-
Method Summary
Modifier and TypeMethodDescriptionfinal booleangetDocIdSet(AtomicReaderContext context, Bits acceptDocs) Returns a DocIdSet with documents that should be permitted in search results.final StringgetField()Returns the field name for this queryfinal inthashCode()toString()
-
Method Details
-
toString
-
equals
-
hashCode
public final int hashCode() -
getField
Returns the field name for this query -
getDocIdSet
Returns a DocIdSet with documents that should be permitted in search results.- Specified by:
getDocIdSetin classFilter- Parameters:
context- aAtomicReaderContextinstance opened on the index currently searched on. Note, it is likely that the provided reader info does not represent the whole underlying index i.e. if the index has more than one segment the given reader only represents a single segment. The provided context is always an atomic context, so you can callAtomicReader.fields()on the context's reader, for example.acceptDocs- Bits that represent the allowable docs to match (typically deleted docs but possibly filtering other documents)- Returns:
- a DocIdSet that provides the documents which should be permitted or
prohibited in search results. NOTE:
nullshould be returned if the filter doesn't accept any documents otherwise internal optimization might not apply in the case an emptyDocIdSetis returned. - Throws:
IOException
-