Grokbase Groups Lucene dev March 2006
FAQ
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

Search Discussions

  • Terry Steichen at Mar 25, 2006 at 3:44 am
    +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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categorieslucene
postedMar 24, '06 at 9:02p
activeMar 25, '06 at 3:44a
posts2
users2
websitelucene.apache.org

2 users in discussion

Markharw00d: 1 post Terry Steichen: 1 post

People

Translate

site design / logo © 2021 Grokbase