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 "Michael J. Prichard" <mi...@mac.com> on 2006/07/31 15:31:56 UTC

Filters or BooleanQuery

This is more of a design question.  I have a ton of email that is 
indexed.  I need to search based on a date range so I use a RangeQuery 
added to a BooleanQuery to search.  This works.  Now I need to include 
another clause that will narrow the result even more.  AND on top of 
that I will need some security applied to the search that will not show 
email to those that it does not belong to.

I could easily go through and add query's but I have a feeling I should 
use a filter somewhere.  What are the best practices when deciding what 
to do?

Thanks,
Michael

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


Re: Filters or BooleanQuery

Posted by Chris Hostetter <ho...@fucit.org>.
: I could easily go through and add query's but I have a feeling I should
: use a filter somewhere.  What are the best practices when deciding what
: to do?

the list archives will have a lot of discussion on this (mainly along the
lines of "should i use a Filter?"  in general the deciding factors should
be...

  1) does the critera in question need to affect scoring -- ie: if you are
searching for new articles with the word "software" and you only want
articles maped to the stock tickers AAPL or IBM, do you care what the term
frequency of the "stockTicker" field is for each document, or what hte
document frequency for those particular tickers are? ... if so a Filter
won't help you.

  2) is the criteria somehting that is reused a lot, and would therfor
make sense to cache independend of the users input -- ie: if a user
is searching for "flash ram" products and they and lots of other users
want to restict to "instock:true" products then a cached Filter could be
really handy.



-Hoss


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