lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Lee <>
Subject Do you believe in Clause sanity?
Date Thu, 13 Oct 2005 20:45:01 GMT
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?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message