Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-9494

CollapseQParserPlugin doesn't propagate needsScores() correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 6.2.1
    • None
    • None

    Description

      CollapseQParserPlugin internally has a number of Lucene Collector implementations, all of which extend Solr DelegatingCollector which provides a default implementation of the method needsScores() based on what it's delegating too. But Collapsing's collectors fail to consider that these collectors themselves sometimes need the score, irrespective of wether or not a delegate might.

      In most cases nobody would notice this bug because most queries don't seem to care. However, SpanQueries are cranky about this, which will either throw an AssertionError or NPE if you ask for a score without saying in advance you wanted them.

      I have a patch forthcoming, but am having trouble ATM reproducing to create a test. The most straight-forward test doesn't trip it. I have a failing test in a client environment, and a patch that fixes it. Reproducing seems to involve a cached query somehow.

      Attachments

        Issue Links

          Activity

            People

              dsmiley David Smiley
              dsmiley David Smiley
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: