lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Soeren Pekrul <>
Subject Re: Scoring depending on terms combination
Date Mon, 13 Nov 2006 09:43:32 GMT
Chris Hostetter wrote:
> that's a pretty specific and not all together intuitive ranking... can you
> elaborate on your actual use case? ... why is B+C better then A+B ? .. are
> these rules specific to a known list of terms, or is a general rule
> relating to how you parse the users input?

The original user query was a Boolean query:
+(A B) +(C D)

It is possible that this query is to restrict. So I would like to give 
the user to the hits matching his original query additional hits.

> off the top of my head, i would suggest building one big BooleanQuery and
> putting each of the permutations you care about in it as subqueries with
> boosts that corripsond to their importance.  you'll probably want to
> disable the coord, and depending on how you want things to work if a doc
> matches your "A+B" clause *and* matches your "B+C" clause you may want to
> use a DisjunctionMaxQuery with a 0.0f tiebreaker value instead of a
> BooleanQuery.

My first idea was sub classing TopDocCollector and overriding the 
collect function. In this function I wanted to ask for terms of the 
current document, calculate the score and call the collect function of 
the base class with the new score as argument. I afraid it takes to much 

Boolean queries for each interesting combination with a corresponding 
boost value should be faster.

Thank you, Hoss.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message