You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Jeff Rodenburg <je...@gmail.com> on 2005/09/09 17:45:17 UTC

BooleanQuery or QueryFilter?

I know this question has been asked before, but I'm not certain of what 
would work best for my scenario. So here goes...

I have an index with documents that carry a broad number of keyword fields, 
usually containing numeric Ids (no sorting, so no leading zeros). From a set 
of search results, I need counts of the results filtered by any one of these 
keyword Id fields. So, for a search yielding 10000 matches, I need to filter 
the search results by Field1 containing the Ids 1,2,3....... and so on. The 
keyword field filter list can be substantial, running into the thousands of 
Ids.

Should I be looking at BooleanQuery, QueryFilter or a custom filter? 
QueryFilter (or customfilter, as I may pull the id values from a db) seem 
like the *best* approach for my scenario. I'm just looking for feedback from 
others who have gone this route and what their experiences yielded.

Thanks,
jeff

Re: BooleanQuery or QueryFilter?

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Sounds like a job for a Filter and CachingWrapperFilter (see
http://www.lucenebook.com/search?query=caching+filter ).  Chris
Hostetter wrote a nice email about how he did this for C|Net maybe 1-2
weeks ago.  Should be in the mailing list archives.

Otis

--- Jeff Rodenburg <je...@gmail.com> wrote:

> I know this question has been asked before, but I'm not certain of
> what 
> would work best for my scenario. So here goes...
> 
> I have an index with documents that carry a broad number of keyword
> fields, 
> usually containing numeric Ids (no sorting, so no leading zeros).
> From a set 
> of search results, I need counts of the results filtered by any one
> of these 
> keyword Id fields. So, for a search yielding 10000 matches, I need to
> filter 
> the search results by Field1 containing the Ids 1,2,3....... and so
> on. The 
> keyword field filter list can be substantial, running into the
> thousands of 
> Ids.
> 
> Should I be looking at BooleanQuery, QueryFilter or a custom filter? 
> QueryFilter (or customfilter, as I may pull the id values from a db)
> seem 
> like the *best* approach for my scenario. I'm just looking for
> feedback from 
> others who have gone this route and what their experiences yielded.
> 
> Thanks,
> jeff
> 


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