Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.3, 6.0
    • Component/s: core/index
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      IndexReader exposes stats like totalTermFreq(term) and docFreq(term). I'd like to add more stats from Terms, e.g. getDocCount/getSumDocFreq/getSumTotalTermFreq(field) for convenience. The implementation is very easy to do on CompositeReader, so I'll add these impls to BaseCompositeReader. I'll attach a patch shortly.

      1. LUCENE-4859.patch
        10 kB
        Shai Erera
      2. LUCENE-4859.patch
        11 kB
        Shai Erera

        Activity

        Hide
        Robert Muir added a comment -

        +1 to this idea. none of these stats cost anything to expose this way... its just summing.

        Show
        Robert Muir added a comment - +1 to this idea. none of these stats cost anything to expose this way... its just summing.
        Hide
        Shai Erera added a comment -

        Patch adds these methods to IndexReader, AtomicReader, BaseCompositeReader and FilterAtomicReader. I also removed MultiFields.totalTermFreq as it already existed on IndexReader. I added tests to TestDirectoryReader.

        Show
        Shai Erera added a comment - Patch adds these methods to IndexReader, AtomicReader, BaseCompositeReader and FilterAtomicReader. I also removed MultiFields.totalTermFreq as it already existed on IndexReader. I added tests to TestDirectoryReader.
        Hide
        Robert Muir added a comment -

        I think maybe it should be final on AtomicReader too, as its just a sugar API for terms(field) + ....

        this way filterreaders are less overwhelmed and there is no possibility of inconsistency.

        Really if a reader returns anything that would be inconsistent with its Terms, its wrong, so why give it the chance

        Show
        Robert Muir added a comment - I think maybe it should be final on AtomicReader too, as its just a sugar API for terms(field) + .... this way filterreaders are less overwhelmed and there is no possibility of inconsistency. Really if a reader returns anything that would be inconsistent with its Terms, its wrong, so why give it the chance
        Hide
        Shai Erera added a comment -

        You're right! Patch removes from Filter and makes final on AR. I think it's ready?

        Show
        Shai Erera added a comment - You're right! Patch removes from Filter and makes final on AR. I think it's ready?
        Hide
        Robert Muir added a comment -

        Yes, looks great. Thanks Shai

        Show
        Robert Muir added a comment - Yes, looks great. Thanks Shai
        Hide
        Shai Erera added a comment -

        Committed to trunk and 4x. Thanks Rob!

        Show
        Shai Erera added a comment - Committed to trunk and 4x. Thanks Rob!
        Hide
        Commit Tag Bot added a comment -

        [trunk commit] Shai Erera
        http://svn.apache.org/viewvc?view=revision&revision=1458907

        LUCENE-4859: Expose more stats on IndexReader

        Show
        Commit Tag Bot added a comment - [trunk commit] Shai Erera http://svn.apache.org/viewvc?view=revision&revision=1458907 LUCENE-4859 : Expose more stats on IndexReader
        Hide
        Commit Tag Bot added a comment -

        [branch_4x commit] Shai Erera
        http://svn.apache.org/viewvc?view=revision&revision=1458914

        LUCENE-4859: Expose more stats on IndexReader

        Show
        Commit Tag Bot added a comment - [branch_4x commit] Shai Erera http://svn.apache.org/viewvc?view=revision&revision=1458914 LUCENE-4859 : Expose more stats on IndexReader
        Hide
        Uwe Schindler added a comment -

        Closed after release.

        Show
        Uwe Schindler added a comment - Closed after release.

          People

          • Assignee:
            Shai Erera
            Reporter:
            Shai Erera
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development