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

Ensure ScoreCachingWrappingScorer doesn't unnecessarily wrap another ScoreCachingWrappingScorer

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 9.0, 8.10
    • 9.0, 8.10
    • core/search
    • None
    • New, Patch Available

    Description

      This is a trivial issue, but it's easy to mistakenly "double wrap" an instance of ScoreCachingWrappingScorer, which is a bit wasteful. The calling code currently needs to check the instance type of the Scorable they intend to wrap to avoid this. FieldComparator is actually the only calling code that does this check.

      It would be nice to add a factory method that encapsulates this check in ScoreCachingWrappingScorer so that calling code doesn't need to worry about it.

       

      Attachments

        Activity

          People

            gsmiller Greg Miller
            gsmiller Greg Miller
            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 - 1h
                1h