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

Scorer should not extend PostingsEnum

Details

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

    Description

      Scorer currently has to implement a whole bunch of methods that are never called. The only method that Scorer uses in addition to the methods on DocIdSetIterator is freq(), and as currently implemented this means different things on different Scorers:

      • TermScorer returns its underlying termfreq
      • MinShouldMatchScorer returns how many of its subscorers are matching
      • {Exact|Sloppy}

        PhraseScorer returns how many phrases it has found on a document

      In addition, freq() is never actually called on TermScorer, and it's only used in explain() on the phrase scorers.

      We should make Scorer extend DocIdSetIterator instead. In place of freq(), Scorer would have a coord() method that by default returns 1, and for boolean scorers returns how many subscorers are matching.

      Attachments

        1. LUCENE-6272.patch
          54 kB
          Alan Woodward
        2. LUCENE-6272.patch
          68 kB
          Alan Woodward
        3. LUCENE-6272.patch
          116 kB
          Alan Woodward

        Activity

          People

            romseygeek Alan Woodward
            romseygeek Alan Woodward
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: