public class BooleanFilter extends Filter implements Iterable<FilterClause>
Constructor and Description |
---|
BooleanFilter() |
Modifier and Type | Method and Description |
---|---|
void |
add(Filter filter,
BooleanClause.Occur occur) |
void |
add(FilterClause filterClause)
Adds a new FilterClause to the Boolean Filter container
|
List<FilterClause> |
clauses()
Returns the list of clauses
|
boolean |
equals(Object obj) |
DocIdSet |
getDocIdSet(AtomicReaderContext context,
Bits acceptDocs)
Returns the a DocIdSetIterator representing the Boolean composition
of the filters that have been added.
|
int |
hashCode() |
Iterator<FilterClause> |
iterator()
Returns an iterator on the clauses in this query.
|
String |
toString()
Prints a user-readable version of this Filter.
|
forEach, spliterator
public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) throws IOException
getDocIdSet
in class Filter
context
- a AtomicReaderContext
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 call
AtomicReader.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)null
should be returned if
the filter doesn't accept any documents otherwise internal optimization might not apply
in the case an empty DocIdSet
is returned.IOException
public void add(FilterClause filterClause)
filterClause
- A FilterClause object containing a Filter and an Occur parameterpublic final void add(Filter filter, BooleanClause.Occur occur)
public List<FilterClause> clauses()
public final Iterator<FilterClause> iterator()
Iterable
interface to
make it possible to do:
for (FilterClause clause : booleanFilter) {}
iterator
in interface Iterable<FilterClause>
Copyright © 2010 - 2020 Adobe. All Rights Reserved