lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: query performance behavior not as expected
Date Tue, 30 Aug 2005 21:04:09 GMT

: The obvious answer here might be to use a filter for the first
: (required) clause and then query again using that filter for the other
: terms.  The problem I forsee with that solution is that I can't easily
: re-use the filters because of the sheer number of combinations of terms
: and the need to re-open my readers/searchers every few minutes to expose
: the steady stream of updates to querying on a regular basis.  As I
: understand it re-using a filter (rather than creating it, using it, and
: discarding it) is integral to it's value as a time saver and thus maybe
: not appropriate in this case.

In my opinion, the second integral aspect ot using a Filter is when you
want to limit which documents are returned without affecting the scores of
the documents -- as Paul pointed out in his reply, that may not be what
you want.

If scores are not important to you (ie: you are sorting by something else)
or if you are happy to have the score only influenced by the "optional"
parts of your initial query, then you can still get abig win out of using
Filters -- the key is to build a filter for each of the individual
required terms, and cache those using CacheWrappingFilter (so the number
of combinations is irrelevant to the cache size) and then use something
like a ChainedFilter to build up the specific combination you need to
Filter you search...

http://svn.apache.org/viewcvs.cgi/lucene/java/trunk/contrib/miscellaneous/src/java/org/apache/lucene/misc/ChainedFilter.java?view=markup


-Hoss


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


Mime
View raw message