I want to combine several filters in a Lucene search. It seems that there are two classes that can help with this: ChainedFilter
and BooleanFilter
.
ChainedFilter
is a contributed class, and has been around for longer. It supports AND, OR, NOT, and XOR.
BooleanFilter
is a newer, main-line class. It supports the unusual "Should", "MustNot", and "Must" operators.
EDIT: Apparently, the "Should" and "Must" syntax is used elsewhere in Lucene for combining Query terms. So even though it's unusual syntax for implementing Boolean logic operations, it's the more normal, idiomatic, typical syntax for Lucene.
But that still leaves my original question: How do I decide which one to use?