lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: RE : BooleanQuery/Clauses with Linked Filters
Date Wed, 25 Feb 2004 15:26:21 GMT
On Feb 25, 2004, at 9:39 AM, Rasik Pandey wrote:
>> On Feb 25, 2004, at 6:48 AM, Rasik Pandey wrote:
>>> I was wondering if it is somehow possible to tie filters to
>> individual
>>> boolean queries/clauses. I didn't see any such possibility
>> with a
>>> quick inspection of the code and I am not sure if a special
>>> HitCollector implementation would be sufficient or even
>> merited. Any
>>> ideas, suggestions, or comments would be appreciated.
>>
>> I'm not following what you mean.  Could you describe a concrete
>> example
>> of what you're after?
>
> Searching Lucene with a BooleanQuery using Searcher.search(Query 
> query, Filter filter) does not allow for coupling filters to 
> sub-queries of the BooleanQuery, but rather coupling a filter to the 
> parent BooleanQuery.

right - you cannot apply filters to subqueries.  A filter is really a 
pre-query screen, not really part of the query itself.

> Currently we can do this:
>
> BooleanQuery not Filter(state, texas) not Filter(country, georgia)
> -TermQuery(city, paris)
> OR
> -TermQuery(state, georgia)
>
>
> instead we would like to be able to do this.
> BooleanQuery
> -TermQuery(city, paris) not Filter(state, texas)
> OR
> -TermQuery(state, georgia) not Filter(country, georgia)
>
>
> Let me know if this isn't clear.

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?

	Erik


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


Mime
View raw message