|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.lucene.search.DocIdSet
org.apache.lucene.search.FilteredDocIdSet
public abstract class FilteredDocIdSet
Abstract decorator class for a DocIdSet implementation that provides on-demand filtering/validation mechanism on a given DocIdSet.
Technically, this same functionality could be achieved with ChainedFilter (under contrib/misc), however the benefit of this class is it never materializes the full bitset for the filter. Instead, thematch(int)
method is invoked on-demand, per docID visited during
searching. If you know few docIDs will be visited, and
the logic behind match(int) is relatively costly,
this may be a better way to filter than ChainedFilter.
DocIdSet| Field Summary |
|---|
| Fields inherited from class org.apache.lucene.search.DocIdSet |
|---|
EMPTY_DOCIDSET |
| Constructor Summary | |
|---|---|
FilteredDocIdSet(DocIdSet innerSet)
Constructor. |
|
| Method Summary | |
|---|---|
boolean |
isCacheable()
This DocIdSet implementation is cacheable if the inner set is cacheable. |
DocIdSetIterator |
iterator()
Implementation of the contract to build a DocIdSetIterator. |
protected abstract boolean |
match(int docid)
Validation method to determine whether a docid should be in the result set. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FilteredDocIdSet(DocIdSet innerSet)
innerSet - Underlying DocIdSet| Method Detail |
|---|
public boolean isCacheable()
isCacheable in class DocIdSet
protected abstract boolean match(int docid)
throws IOException
docid - docid to be tested
IOException
public DocIdSetIterator iterator()
throws IOException
iterator in class DocIdSetIOExceptionDocIdSetIterator,
FilteredDocIdSetIterator
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||