Class LuceneIndexStatistics

  • All Implemented Interfaces:

    public class LuceneIndexStatistics
    extends java.lang.Object
    This class would populate some statistics from a reader. We want to be careful here such that we only collect statistics which don't incur reads from the index i.e. we would only collect stats that lucene would already have read into memory when the reader was opened.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getDocCountFor​(java.lang.String field)  
      int numDocs()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • numDocs

        public int numDocs()
        Specified by:
        numDocs in interface
        number of documents in the index
      • getDocCountFor

        public int getDocCountFor​(java.lang.String field)
        Specified by:
        getDocCountFor in interface
        field - Index field for which number of indexed documents are to be return
        number of indexed documents (without subtracting potentially deleted ones) for the given field.
        -1: if index codec doesn't store doc-count-for-field statistics, OR
              reader threw an exception while reading fields, OR
              exception thrown while reading count for the field, OR
              doc-count is asked for a non-property field.