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
public class MultiTermQueryWrapperFilter<Q extends MultiTermQuery> extends Filter
A wrapper forMultiTermQuery
, that exposes its functionality as aFilter
.MultiTermQueryWrapperFilter
is not designed to be used by itself. Normally you subclass it to provide a Filter counterpart for aMultiTermQuery
subclass.For example,
TermRangeFilter
andPrefixFilter
extendMultiTermQueryWrapperFilter
. This class also provides the functionality behindMultiTermQuery.CONSTANT_SCORE_FILTER_REWRITE
; this is why it is not abstract.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
MultiTermQueryWrapperFilter(Q query)
Wrap aMultiTermQuery
as a Filter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
DocIdSet
getDocIdSet(AtomicReaderContext context, Bits acceptDocs)
Returns a DocIdSet with documents that should be permitted in search results.String
getField()
Returns the field name for this queryint
hashCode()
String
toString()
-
-
-
Field Detail
-
query
protected final Q extends MultiTermQuery query
-
-
Constructor Detail
-
MultiTermQueryWrapperFilter
protected MultiTermQueryWrapperFilter(Q query)
Wrap aMultiTermQuery
as a Filter.
-
-
Method Detail
-
getField
public final String getField()
Returns the field name for this query
-
getDocIdSet
public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) throws IOException
Returns a DocIdSet with documents that should be permitted in search results.- Specified by:
getDocIdSet
in classFilter
- Parameters:
context
- aAtomicReaderContext
instance 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:
null
should be returned if the filter doesn't accept any documents otherwise internal optimization might not apply in the case an emptyDocIdSet
is returned. - Throws:
IOException
-
-