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

Make sure to account for ScoreMode.TOP_DOCS in queries

Details

    • Test
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • core/search
    • None
    • New

    Description

      I noticed a few places where we are directly check the ScoreMode type that should perhaps be generalized. These could affect whether numeric sort optimization is applied:

      • In BooleanWeight#bulkScorer, we check if score mode is TOP_SCORES and if so, force non-bulk scoring. Should we expand this to include modes like TOP_DOCS?
      • In ConstantScoreQuery, we create the delegate weight with a hardcoded COMPLETE_NO_SCORES. I'm not sure it actually causes problems, but it seems like this doesn't handle TOP_DOCS correctly.

      Apologies this issue isn’t more precise – I am not up-to-speed on the numeric sort optimization but wanted to raise these in case they’re helpful.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jtibshirani Julie Tibshirani

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m

                  Slack

                    Issue deployment