You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by mark harwood <ma...@yahoo.co.uk> on 2006/09/25 18:54:49 UTC

RangeQuery - rewrite to a RangeFilter in a ConstantScoreQuery?

Given the trouble people routinely get themselves into using RangeQuery would it make sense to change the "rewrite" method to generate a ConstantScoreQuery wrapping a RangeFilter?

The only disadvantages I can see would be:

1) Scoring would change - some users may find their apps produce different scores for queries which they have tuned "match thresholds" for.
2) Highlighting would not work for RangeQueries (not something I would normally see as useful)
3) Explain() would not work the same


This is to be weighed up against the advantages of:

1) Faster queries for most users (see method 1 vs method 4 in http://wiki.apache.org/jakarta-lucene/FilteringOptions - 4 times faster in that benchmark)
2) No more "too many clauses" exceptions foxing end users
3) Scoring would change - normally for the better. The IDF of terms produced by the range query is no longer a factor that skews results eg scenarios where the Sundays in a date range typically rank higher because less documents are posted on that day.

The change wouldn't break the API and therefore require changes to people's client code.

Thoughts?




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


Re: RangeQuery - rewrite to a RangeFilter in a ConstantScoreQuery?

Posted by Chris Hostetter <ho...@fucit.org>.
: Given the trouble people routinely get themselves into using RangeQuery
: would it make sense to change the "rewrite" method to generate a
: ConstantScoreQuery wrapping a RangeFilter?

As much as i hate RangeQuery, i can imagine situations where people wnat
the scoring subtleties that it currently provides -- but i don't think
they are the common case.

It we want to reduce the number of "accidental" uses of RangeQuery, it
probably makes more senese to just replace it's usage in QueryParser, but
leave the rewrite method alone -- the class javadocs should also indicate
that you most likely do *not* want to use it, and should instead
probably use ConstantScoringRangeQuery -- i would go so far as to mark
RangeQuery an "Expert" class.



-Hoss


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