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

IndexSearcher.termStatistics should not require TermStates but docFreq and totalTermFreq

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 8.1
    • Fix Version/s: 8.3
    • Component/s: core/search
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      IndexSearcher.termStatistics(Term term, TermStates context) is the way to create a TermStatistics. It requires a TermStates param although it only cares about the docFreq and totalTermFreq.

       

      For customizations that what to create TermStatistics based on docFreq and totalTermFreq, but that do not have available TermStates, this method forces to create a TermStates instance (which is not very lightweight) only to pass two ints.

      termStatistics could be modified to the following signature:

      termStatistics(Term term, int docFreq, int totalTermFreq)

      Since it would change the API, it could be done in master for next major release.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dsmiley David Smiley
                Reporter:
                bruno.roustant Bruno Roustant
              • Votes:
                0 Vote for this issue
                Watchers:
                5 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 - 3h
                  3h