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

Calculating minimum score instead of maximum score in ToParentBlockJoinQuery.BlockJoinScorer.setScoreAndFreq

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 6.6, 7.0
    • None
    • None
    • New

    Description

      We recently upgraded our Elasticsearch cluster from 5.3 to 5.4 and found a bug when we score nested documents.

      I spent some time to check the code from Elasticsearch and Lucene and I found a problem in ToParentBlockJoinQuery.BlockJoinScorer.setScoreAndFreq.

      In the switch statement for the scoreMode in the case "Max" the function Math.min is used and I guess it should be Math.max.

      This would explain our problem in Elasticsearch because we see exactly the problem that instead of the maximum the minimum is returned.

      Attachments

        1. LUCENE-7833.patch
          4 kB
          Adrien Grand

        Issue Links

          Activity

            People

              Unassigned Unassigned
              baltendo Bernhard Altendorfer
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: