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

unnecessary for-loop in WeightedSpanTermExtractor.extractWeightedSpanTerms

Details

    • Task
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 10.0 (main), 8.11.2, 9.2
    • None
    • None
    • New

    Description

      The https://github.com/apache/lucene/commit/81c7ba4601a9aaf16e2255fe493ee582abe72a90 change in LUCENE-4728 included

      - final SpanQuery rewrittenQuery = (SpanQuery) spanQuery.rewrite(getLeafContextForField(field).reader());
      + final SpanQuery rewrittenQuery = (SpanQuery) spanQuery.rewrite(getLeafContext().reader());
      

      i.e. previously more needed to happen in the loop but now the query rewrite and term collecting need not happen in the loop.

      Attachments

        Issue Links

          Activity

            People

              cpoerschke Christine Poerschke
              cpoerschke Christine Poerschke
              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 20m
                  1h 20m