public abstract class FilteredDocIdSet extends DocIdSet
Technically, this same functionality could be achieved
with ChainedFilter (under queries/), however the
benefit of this class is it never materializes the full
bitset for the filter. Instead, the match(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
Constructor and Description |
---|
FilteredDocIdSet(DocIdSet innerSet)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Bits |
bits() |
Collection<Accountable> |
getChildResources() |
DocIdSet |
getDelegate()
Return the wrapped
DocIdSet . |
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.
|
long |
ramBytesUsed() |
public FilteredDocIdSet(DocIdSet innerSet)
innerSet
- Underlying DocIdSetpublic long ramBytesUsed()
public Collection<Accountable> getChildResources()
public Bits bits() throws IOException
bits
in class DocIdSet
IOException
protected abstract boolean match(int docid)
docid
- docid to be testedpublic DocIdSetIterator iterator() throws IOException
iterator
in class DocIdSet
IOException
DocIdSetIterator
,
FilteredDocIdSetIterator
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.