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

Optimize TopField and TopScoreDoc collector by only counting hits when necessary

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 9.2
    • None
    • None
    • New

    Description

      The current implementations of TopFieldCollector and TopScoreDocCollector count the number of hits as part of their HitsThresholdChecker impl. When early termination is disabled, meaning when total hits is Integer.MAX_VALUE, counting as well as accumulating scores in MaxScoreAccumulator is not necessary.

      We could optimize these two collector by disabling the counting as well as scores accumulation when early termination is not possible.

      This is a spin-off of LUCENE-10486.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lucacavanna Luca Cavanna
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

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