Package org.apache.lucene.search
Class MultiTermQueryWrapperFilter<Q extends MultiTermQuery>
- java.lang.Object
-
- org.apache.lucene.search.Filter
-
- org.apache.lucene.search.MultiTermQueryWrapperFilter<Q>
-
- All Implemented Interfaces:
Serializable
- 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.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
MultiTermQueryWrapperFilter(Q query)
Wrap aMultiTermQuery
as a Filter.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
clearTotalNumberOfTerms()
Deprecated.Don't use this method, as its not thread safe and useless.boolean
equals(Object o)
DocIdSet
getDocIdSet(IndexReader reader)
Returns a DocIdSet with documents that should be permitted in search results.int
getTotalNumberOfTerms()
Deprecated.Don't use this method, as its not thread safe and useless.int
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
-
getTotalNumberOfTerms
@Deprecated public int getTotalNumberOfTerms()
Deprecated.Don't use this method, as its not thread safe and useless.Expert: Return the number of unique terms visited during execution of the filter. If there are many of them, you may consider using another filter type or optimize your total term count in index.This method is not thread safe, be sure to only call it when no filter is running! If you re-use the same filter instance for another search, be sure to first reset the term counter with
clearTotalNumberOfTerms()
.- See Also:
clearTotalNumberOfTerms()
-
clearTotalNumberOfTerms
@Deprecated public void clearTotalNumberOfTerms()
Deprecated.Don't use this method, as its not thread safe and useless.Expert: Resets the counting of unique terms. Do this before executing the filter.- See Also:
getTotalNumberOfTerms()
-
getDocIdSet
public DocIdSet getDocIdSet(IndexReader reader) throws IOException
Returns a DocIdSet with documents that should be permitted in search results.- Specified by:
getDocIdSet
in classFilter
- Parameters:
reader
- aIndexReader
instance opened on the index currently searched on. Note, it is likely that the provided reader 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.- Returns:
- a DocIdSet that provides the documents which should be permitted or prohibited in search results. NOTE: null can be returned if no documents will be accepted by this Filter.
- Throws:
IOException
- See Also:
DocIdBitSet
-
-