FAQ
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@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org

Search Discussions

  • Ian Lea at Jul 26, 2011 at 11:01 am
    Have you tried CustomScoreQuery/CustomScoreProvider? Complicated but powerful.


    --
    Ian.


    On Mon, Jul 25, 2011 at 9:29 AM, Pavel Goncharik
    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@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • Pavel Goncharik at Mar 27, 2012 at 9:58 pm
    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 wrote:
    Have you tried CustomScoreQuery/CustomScoreProvider?  Complicated but powerful.


    --
    Ian.


    On Mon, Jul 25, 2011 at 9:29 AM, Pavel Goncharik
    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@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org
  • Robert Muir at Mar 28, 2012 at 3:31 pm

    On Tue, Mar 27, 2012 at 5:58 PM, Pavel Goncharik 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@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedJul 25, '11 at 8:30a
activeMar 28, '12 at 3:31p
posts4
users3
websitelucene.apache.org

People

Translate

site design / logo © 2022 Grokbase