Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-6042

CustomScoreQuery Explain differs from the actual score when topLevelBoost is used.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.8
    • Fix Version/s: 4.10.3, 5.0, 6.0
    • Component/s: core/query/scoring
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      CustomScoreQuery.java, doExplain has the following line:

      res.addDetail(new Explanation(getBoost(), "queryBoost"));
      

      This multiplies the custom score query by just the boost of the current query, and not by

      queryWeight=topLevelBoost*getBoost();
      

      which is the value that's actually used during scoring. This leads to drastically different scores in the debug info, relative to the actual score, when the query is a subquery of another one, like a BooleanQuery clause, with a non-1 boost.

        Attachments

        1. CustomScoreQuery.patch
          1 kB
          Denis Lantsman
        2. LUCENE-6042.patch
          16 kB
          Robert Muir

          Activity

            People

            • Assignee:
              rcmuir Robert Muir
              Reporter:
              dlants Denis Lantsman
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified