Package org.apache.lucene.search
Class FieldCacheDocIdSet
- java.lang.Object
-
- org.apache.lucene.search.DocIdSet
-
- org.apache.lucene.search.FieldCacheDocIdSet
-
public abstract class FieldCacheDocIdSet extends DocIdSet
Base class for DocIdSet to be used with FieldCache. The implementation of its iterator is very stupid and slow if the implementation of thematchDoc(int)
method is not optimized, as iterators simply increment the document id untilmatchDoc(int)
returns true. Because of thismatchDoc(int)
must be as fast as possible and in no case do any I/O.- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
-
Field Summary
Fields Modifier and Type Field Description protected IndexReader
reader
-
Fields inherited from class org.apache.lucene.search.DocIdSet
EMPTY_DOCIDSET
-
-
Constructor Summary
Constructors Constructor Description FieldCacheDocIdSet(IndexReader reader)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
isCacheable()
this DocIdSet is cacheable, if it works solely with FieldCache and no TermDocsDocIdSetIterator
iterator()
Provides aDocIdSetIterator
to access the set.protected abstract boolean
matchDoc(int doc)
this method checks, if a doc is a hit
-
-
-
Field Detail
-
reader
protected final IndexReader reader
-
-
Constructor Detail
-
FieldCacheDocIdSet
public FieldCacheDocIdSet(IndexReader reader)
-
-
Method Detail
-
matchDoc
protected abstract boolean matchDoc(int doc)
this method checks, if a doc is a hit
-
isCacheable
public final boolean isCacheable()
this DocIdSet is cacheable, if it works solely with FieldCache and no TermDocs- Overrides:
isCacheable
in classDocIdSet
-
iterator
public final DocIdSetIterator iterator() throws IOException
Description copied from class:DocIdSet
Provides aDocIdSetIterator
to access the set. This implementation can returnnull
orDocIdSet.EMPTY_DOCIDSET.iterator()
if there are no docs that match.- Specified by:
iterator
in classDocIdSet
- Throws:
IOException
-
-