Class LuceneIndexStatistics

java.lang.Object
org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexStatistics
All Implemented Interfaces:
org.apache.jackrabbit.oak.plugins.index.search.IndexStatistics

public class LuceneIndexStatistics extends Object implements org.apache.jackrabbit.oak.plugins.index.search.IndexStatistics
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 Details

    • numDocs

      public int numDocs()
      Specified by:
      numDocs in interface org.apache.jackrabbit.oak.plugins.index.search.IndexStatistics
      Returns:
      number of documents in the index
    • getDocCountFor

      public int getDocCountFor(String field)
      Specified by:
      getDocCountFor in interface org.apache.jackrabbit.oak.plugins.index.search.IndexStatistics
      Parameters:
      field - Index field for which number of indexed documents are to be return
      Returns:
      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.