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

ScoreMode not always set correctly in Solr queries

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.1, 7.3.1
    • 7.4
    • search
    • None

    Description

      A query can be informed that scores are not needed based on it's context/use, and some queries are able to operate more efficiently if it knows this up-front. This is about the ScoreMode enum.

      I reviewed the use of ScoreMode.COMPLETE in Solr and I think we should make the following changes:

      Solr filter queries (fq) are non-scoring. SolrIndexSearcher.getProcessedFilter will pass ScoreMode.COMPLETE when it ought to be COMPLETE_NO_SCORES to createWeight. This perf bug is only applicable when the filter query is not cached (either cache=false local-param or no filter cache). This error was made in LUCENE-6220 (Solr 5.1); at that time it was a boolean.

      The /export handler (more specifically ExportQParserPlugin) is also affected; it's COMPLETE when it should always be COMPLETE_NO_SCORES. Also appears to be in error since Solr 5.1.

      SolrIndexSearcher.getDocListAndSetNC ought to use TOP_SCORES to track the top-score to be more correct but it's a distinction without a difference since MultiCollector.wrap with the DocSetCollector will combine it with COMPLETE_NO_SCORES to conclude the result is COMPLETE.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            dsmiley David Smiley
            dsmiley David Smiley
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment