org.apache.lucene.misc
public class: ChainedFilter [javadoc |
source]
java.lang.Object
org.apache.lucene.search.Filter
org.apache.lucene.misc.ChainedFilter
All Implemented Interfaces:
Serializable
Allows multiple 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.
- author:
< - a href="mailto:kelvint@apache.org">Kelvin Tan
| Field Summary |
|---|
| public static final int | OR | BitSet#or . |
| public static final int | AND | BitSet#and . |
| public static final int | ANDNOT | BitSet#andNot . |
| public static final int | XOR | BitSet#xor . |
| public static int | DEFAULT | Logical operation when none is declared. Defaults to
BitSet#or . |
| Constructor: |
public ChainedFilter(Filter[] chain) {
this.chain = chain;
}
Parameters:
chain - The chain of filters
|
public ChainedFilter(Filter[] chain,
int[] logicArray) {
this.chain = chain;
this.logicArray = logicArray;
}
Parameters:
chain - The chain of filters
logicArray - Logical operations to apply between filters
|
public ChainedFilter(Filter[] chain,
int logic) {
this.chain = chain;
this.logic = logic;
}
Parameters:
chain - The chain of filters
logic - Logicial operation to apply to ALL filters
|
| Method from org.apache.lucene.misc.ChainedFilter Summary: |
|---|
|
bits, toString |
| Methods from org.apache.lucene.search.Filter: |
|---|
|
bits |
| Method from org.apache.lucene.misc.ChainedFilter Detail: |
public BitSet bits(IndexReader reader) throws IOException {
if (logic != -1)
return bits(reader, logic);
else if (logicArray != null)
return bits(reader, logicArray);
else
return bits(reader, DEFAULT);
}
|
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("ChainedFilter: [");
for (int i = 0; i < chain.length; i++)
{
sb.append(chain[i]);
sb.append(' ");
}
sb.append(']");
return sb.toString();
}
|