Class IndexSizeEstimator

java.lang.Object
org.apache.solr.handler.admin.IndexSizeEstimator

public class IndexSizeEstimator extends Object
Estimates the raw size of all uncompressed indexed data by scanning term, docValues and stored fields data. This utility also provides detailed statistics about term, docValues, postings and stored fields distributions.
  • Field Details

  • Constructor Details

    • IndexSizeEstimator

      public IndexSizeEstimator(org.apache.lucene.index.IndexReader reader, int topN, int maxLength, boolean withSummary, boolean withDetails)
  • Method Details

    • setSamplingThreshold

      public void setSamplingThreshold(int threshold)
      Set the sampling threshold. If the index has more documents than this threshold then only some values will be sampled and the totals will be extrapolated.
      Parameters:
      threshold - size threshold (number of documents). Default value is DEFAULT_SAMPLING_THRESHOLD. Setting this to values <= 0 means no threshold (and no sampling).
    • setSamplingPercent

      public void setSamplingPercent(float percent) throws IllegalArgumentException
      Sampling percent (a number greater than 0 and less or equal to 100). When index size exceeds the threshold then approximately only this percent of data will be retrieved from the index and the totals will be extrapolated.
      Parameters:
      percent - sample percent. Default value is DEFAULT_SAMPLING_PERCENT.
      Throws:
      IllegalArgumentException - when value is less than or equal to 0.0 or greater than 100.0, or the sampling percent is so small that less than 10 documents would be sampled.
    • estimate

      public IndexSizeEstimator.Estimate estimate() throws Exception
      Throws:
      Exception
    • main

      public static void main(String[] args) throws Exception
      Throws:
      Exception