lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Terry Steichen <te...@net-frame.com>
Subject Re: BooleanFilter proposal
Date Sat, 25 Mar 2006 03:44:12 GMT
+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: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message