+1
markharw00d wrote:
What do folks feel about a BooleanFilter which is the equivalent of
BooleanQuery ie a filter which contains other filters, combined with
the same "must", "should" or "must not" logic.
I know we already have ChainedFilter in the "misc" section of the
contrib area but its methods do not echo the approach taken by
BooleanQuery - and this means people have to think about their boolean
logic for filters differently to queries eg
* AND is used instead of MUST etc.
* the sequence of elements in the chain are important whereas for a
BooleanQuery they are order-independent.
I have an implementation (thanks, Brett) which has the following API:
class BooleanFilter extends Filter
public void addClause(FilterClause filterClause)
....
class FilterClause
public FilterClause(Occur occur, Filter filter)
{
this.occur = occur;
this.filter = filter;
}
Some examples of how some typical filters might be mixed in a Boolean
filter:
example "should" filters: - price range filters, date range filters
example "must not" filters:- stockDeleted=Y TermsFilter
example "must" filter: security restrictions eg userRole:admin
TermsFilter
This class allows you to mix all these filters into the one filter.
The "must" elements eg security restrictions would override the other
elements.
Do people think this is worth adding to the "contrib" section ?
Cheers,
Mark
___________________________________________________________ Yahoo!
Photos – NEW, now offering a quality print service from just 8p a
photo http://uk.photos.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]