Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-User

boolean score calculation

 

 

Lucene java-user RSS feed   Index | Next | Previous | View Threaded


pavel.goncharik at gmail

Jul 25, 2011, 1:29 AM

Post #1 of 4 (304 views)
Permalink
boolean score calculation

Hi,

as far as I can see, boolean scorers always sum up scores of their
sub-scorers. It works, but in case of my application it's required to
multiply sub-scores.
Is there a simple/efficient way to do this (apart from modifying
lucene's source code)?
It seems to me that standard tricks (e.g. CustomScoreQuery or custom
Similarity) would not help me in this case.

Thanks in advance for helping!

- Pavel

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


ian.lea at gmail

Jul 26, 2011, 4:00 AM

Post #2 of 4 (286 views)
Permalink
Re: boolean score calculation [In reply to]

Have you tried CustomScoreQuery/CustomScoreProvider? Complicated but powerful.


--
Ian.


On Mon, Jul 25, 2011 at 9:29 AM, Pavel Goncharik
<pavel.goncharik [at] gmail> wrote:
> Hi,
>
> as far as I can see, boolean scorers always sum up scores of their
> sub-scorers. It works, but in case of my application it's required to
> multiply sub-scores.
> Is there a simple/efficient way to do this (apart from modifying
> lucene's source code)?
> It seems to me that standard tricks (e.g. CustomScoreQuery or custom
> Similarity) would not help me in this case.
>
> Thanks in advance for helping!
>
> - Pavel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
> For additional commands, e-mail: java-user-help [at] lucene
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


pavel.goncharik at gmail

Mar 27, 2012, 2:58 PM

Post #3 of 4 (171 views)
Permalink
Re: boolean score calculation [In reply to]

Dear Lucene users and developers,

sorry for getting back to this old subject, but we are in the position
of re-evaluating our current implementation, which uses re-compiled
version of Lucene 3 with boolean scorers multiplying sub-scores. I was
hoping that "flexible ranking" in Lucene 4 will provide a mechanism
for that, but after a brief look it seems that "adition" is still
locked in corresponding implementations of boolean scorers. I also can
not see how CustomScoreQuery, suggested below, might help, so here we
go again.

To illustrate the problem with a simplified example, think of a
boolean query, comprised of 3 sub-clauses (A and B and C):
then if for document #1 the score for query A = 3, for B = 3, for C =
3, then result score 3 + 3 + 3 = 9;
and for another document #2 where score for A = 8, for B = 1 and for C
= 1, result score 8 + 1 + 1 = 10.

The thing is that in my case doc #1 is much more important, because
its sub-clauses are "represented" much more evenly than in the doc #2,
where B and C are represented poorly and it bubbles up only because of
over-blown (for whatever reason) score of A. What's needed is some
mechanism to represent poorness of B and C stronger - e.g. simple
multiplication instead of addition, so that the score for doc #1 =
3*3*3 = 27 and for doc #2 = 8*1*1 = 8, and doc #1 wins.

1) do I miss something in Lucene 3 or 4?
2) wouldn't it be much more flexible, if there was an easy-to-override
method/parameter in e.g. Similarity or BooleanQuery, to be invoked by
boolean scorers for calculating compound score of boolean sub-clauses?


On Tue, Jul 26, 2011 at 1:00 PM, Ian Lea <ian.lea [at] gmail> wrote:
> Have you tried CustomScoreQuery/CustomScoreProvider?  Complicated but powerful.
>
>
> --
> Ian.
>
>
> On Mon, Jul 25, 2011 at 9:29 AM, Pavel Goncharik
> <pavel.goncharik [at] gmail> wrote:
>> Hi,
>>
>> as far as I can see, boolean scorers always sum up scores of their
>> sub-scorers. It works, but in case of my application it's required to
>> multiply sub-scores.
>> Is there a simple/efficient way to do this (apart from modifying
>> lucene's source code)?
>> It seems to me that standard tricks (e.g. CustomScoreQuery or custom
>> Similarity) would not help me in this case.
>>
>> Thanks in advance for helping!
>>
>> - Pavel
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
>> For additional commands, e-mail: java-user-help [at] lucene
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
> For additional commands, e-mail: java-user-help [at] lucene
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


rcmuir at gmail

Mar 28, 2012, 8:31 AM

Post #4 of 4 (170 views)
Permalink
Re: boolean score calculation [In reply to]

On Tue, Mar 27, 2012 at 5:58 PM, Pavel Goncharik
<pavel.goncharik [at] gmail> wrote:
> 1) do I miss something in Lucene 3 or 4?
> 2) wouldn't it be much more flexible, if there was an easy-to-override
> method/parameter in e.g. Similarity or BooleanQuery, to be invoked by
> boolean scorers for calculating compound score of boolean sub-clauses?
>

no. because its DisjunctionSumScorer. so it sums.
practically speaking, if you want that to act like multiplication for
ranking purposes, can't you just take the log in your similarity?

--
lucidimagination.com

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene

Lucene java-user RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.