FAQ
The API for BooleanQuery only seems to allow adding clauses. The
nearest way I can see to *remove* a clause is by laboriously
constructing a new BooleanQuery (assuming you aren't absolutely tied
to the original instance) and adding all the clauses from the
original query except the one you're removing. And *that's* rather
cumbersome because you can't actually add a clause; you have to use
one of the addRequired-/addProhibited- methods -- and they take
arrays of String rather than the array of Term that you can get from
a Clause.

It seems reasonable to me to want to remove clauses from a query. Is
there some reasonable way of doing this that I'm missing?

--Andy


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Search Discussions

  • Andy Lee at Oct 13, 2005 at 9:24 pm
    Oops, I'm confusing libraries. I meant I want to remove a Nutch
    Clause from a Nutch Query.

    --Andy
    On Oct 13, 2005, at 4:45 PM, Andy Lee wrote:

    The API for BooleanQuery only seems to allow adding clauses. The
    nearest way I can see to *remove* a clause is by laboriously
    constructing a new BooleanQuery (assuming you aren't absolutely
    tied to the original instance) and adding all the clauses from the
    original query except the one you're removing. And *that's* rather
    cumbersome because you can't actually add a clause; you have to use
    one of the addRequired-/addProhibited- methods -- and they take
    arrays of String rather than the array of Term that you can get
    from a Clause.

    It seems reasonable to me to want to remove clauses from a query.
    Is there some reasonable way of doing this that I'm missing?

    --Andy


    ---------------------------------------------------------------------
    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]

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedOct 13, '05 at 8:45p
activeOct 13, '05 at 9:24p
posts2
users1
websitelucene.apache.org

1 user in discussion

Andy Lee: 2 posts

People

Translate

site design / logo © 2023 Grokbase