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 Maxim Patramanskij <ma...@osua.de> on 2006/12/12 12:15:08 UTC

Complex query filtering

I need to apply a set of custom filters to my query.
One of the filters, which optionally can be applied, is a filter by
date range.

For the moment I'm using a BooleanQuery approach for this.
I know that it is not the best from the score accuracy nor performance
point of view and I want change this to use FilteredQuery approach.

I' assuming the following approach to re-implement current state:

1. For all the filters, excluding filter by date, I still create a
BooleanQuery.

2. For filtering by date, I create  RangeFilter and wrap it around
with a ConstantScoreQuery.

3. Create a new BooleanQuery from the queries, obtained on 1 and 2 step

4. Create a QueryFilter from the BooleanQuery, created on step 3.

5. Use FilteredQuery, created from user query and QueryFilter(or even surrounded
with CachingWrapperFilter for better performance), created on previous step.


Would this solution be the best approach for constructing overall filter?

Thanks in advance,
Max


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