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

Do not expose full-fledged scorers in LeafCollector.setScorer

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 8.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Currently LeafCollector.setScorer takes a Scorer, which I don't like because several methods should never be called in the context of a Collector (like nextDoc or advance).

      I think it's even more trappy for methods that might seem to work in some particular cases but will not work in the general case, like getChildren which will not work if you have a specialized BulkScorer or iterating over positions which will not work if you are in a MultiCollector and another leaf collector consumes positions too.

      So I think we should restrict what can be seen from a collector to avoid such traps.

        Attachments

        1. LUCENE-6228.patch
          134 kB
          Alan Woodward
        2. LUCENE-6228.patch
          119 kB
          Alan Woodward
        3. LUCENE-6228.patch
          95 kB
          Alan Woodward
        4. LUCENE-6228.patch
          206 kB
          Adrien Grand
        5. LUCENE-6228.patch
          166 kB
          Adrien Grand
        6. LUCENE-6228.patch
          134 kB
          Adrien Grand

          Issue Links

            Activity

              People

              • Assignee:
                romseygeek Alan Woodward
                Reporter:
                jpountz Adrien Grand
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: