org.apache.lucene.misc
public class ChainedFilter extends Filter
Allows multiple {@link Filter}s to be chained. Logical operations such as NOT and XOR are applied between filters. One operation can be used for all filters, or a specific operation can be declared for each filter.
Order in which filters are called depends on the position of the filter in the chain. It's probably more efficient to place the most restrictive filters /least computationally-intensive filters first.
Field Summary | |
---|---|
static int | AND
{@link BitSet#and}. |
static int | ANDNOT
{@link BitSet#andNot}. |
static int | DEFAULT
Logical operation when none is declared. |
static int | OR
{@link BitSet#or}. |
static int | XOR
{@link BitSet#xor}. |
Constructor Summary | |
---|---|
ChainedFilter(Filter[] chain)
Ctor. | |
ChainedFilter(Filter[] chain, int[] logicArray)
Ctor. | |
ChainedFilter(Filter[] chain, int logic)
Ctor. |
Method Summary | |
---|---|
BitSet | bits(IndexReader reader)
{@link Filter#bits}. |
String | toString()
First AND operation takes place against a completely false
bitset and will always return zero results. |
Parameters: chain The chain of filters
Parameters: chain The chain of filters logicArray Logical operations to apply between filters
Parameters: chain The chain of filters logic Logicial operation to apply to ALL filters