You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Rasik Pandey <ra...@ajlsm.com> on 2004/02/25 17:51:58 UTC

RE : RE : BooleanQuery/Clauses with Linked Filters

> Its still not entirely clear, but it seems you could accomplish
> what
> you want by putting in some AND TermQuery's in there instead of
> trying
> to use a Filter.  Wouldn't that do what you want?

Ok so the example wasn't as concrete as it should have been and you are right about the fact that I could add some more sub-queries to get the same effect. 

Our particular case concerns adding or doing a "date query" for which we are using a DateFilter. We were using a DateFilter to represent one of the nested sub-queries, but since that is only possible at the same level of a complex parent BooleanQuery, this obviously would affect the results globally instead of respecting the nesting.  Maybe the answer is the RangeQuery? I need to research that....

In general, what is the performance gain, if any, when using a Filter vs. adding an extra BooleanClause to retrieve the same results?


RBP 



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


Re: RE : RE : BooleanQuery/Clauses with Linked Filters

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Feb 25, 2004, at 11:51 AM, Rasik Pandey wrote:
> Our particular case concerns adding or doing a "date query" for which 
> we are using a DateFilter. We were using a DateFilter to represent one 
> of the nested sub-queries, but since that is only possible at the same 
> level of a complex parent BooleanQuery, this obviously would affect 
> the results globally instead of respecting the nesting.  Maybe the 
> answer is the RangeQuery? I need to research that....

Yeah, RangeQuery sounds like the right thing to do in your case.

> In general, what is the performance gain, if any, when using a Filter 
> vs. adding an extra BooleanClause to retrieve the same results?

I'm not sure it can be generalized - it would depend on the query and 
the filter you're comparing.  But generally a Filter has upfront work 
to do to create the filter bit set.  For a DateFilter, this involves 
enumerating the terms in the range.  The QueryFilter performs an actual 
query, so it would be dependent on what it needed to do.

Filters are good when you can create them and let them live over the 
the course of multiple queries.

	Erik


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