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

Remove Scorer.freq()

    XMLWordPrintableJSON

    Details

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

      Description

      At the moment, Scorer.freq() does different things depending on the Scorer implementation:

      • TermScorer and the phrase scorers return the frequency of that term or phrase in the current document. TermScorer.freq() is not actually called anywhere (apart from in a couple of tests), and XPhraseScorer.freq() is only called in PhraseWeight.explain()
      • The various Boolean scorers return the number of matching subscorers, and are used for coord calculations.

      I think this is confusing. I propose that we instead add a new coord() method to Scorer that by default returns 1, and that is overridden by the boolean scorers; and that we just remove freq() entirely. PhraseWeight.explain() can call a package-private method on XPhraseScorer.

        Attachments

        1. LUCENE-6278.patch
          49 kB
          Alan Woodward
        2. LUCENE-6278.patch
          57 kB
          Alan Woodward
        3. LUCENE-6278.patch
          56 kB
          Alan Woodward

          Activity

            People

            • Assignee:
              romseygeek Alan Woodward
              Reporter:
              romseygeek Alan Woodward
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: