org.apache.lucene.search

## Class CollectionStatistics

- java.lang.Object
- - org.apache.lucene.search.CollectionStatistics

    public class CollectionStatistics
    extends Object

Contains statistics for a collection (field)

WARNING: This API is experimental and might change in incompatible ways in the next release.

### Constructor Summary

Constructors
Constructor and Description
`CollectionStatistics(String field, long maxDoc, long docCount, long sumTotalTermFreq, long sumDocFreq)`

### Method Summary

All Methods Instance Methods Concrete Methods
`long` `docCount()` returns the total number of documents that have at least one term for this field.
`String` `field()` returns the field name
`long` `maxDoc()` returns the total number of documents, regardless of whether they all contain values for this field.
`long` `sumDocFreq()` returns the total number of postings for this field
`long` `sumTotalTermFreq()` returns the total number of tokens for this field

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### CollectionStatistics

    public CollectionStatistics(String field,
                                long maxDoc,
                                long docCount,
                                long sumTotalTermFreq,
                                long sumDocFreq)

### Method Detail

#### field

    public final String field()

returns the field name

#### maxDoc

    public final long maxDoc()

returns the total number of documents, regardless of whether they all contain values for this field.

See Also:
  `IndexReader.maxDoc()`

#### docCount

    public final long docCount()

returns the total number of documents that have at least one term for this field.

See Also:
  `Terms.getDocCount()`

#### sumTotalTermFreq

    public final long sumTotalTermFreq()

returns the total number of tokens for this field

See Also:
  `Terms.getSumTotalTermFreq()`

#### sumDocFreq

    public final long sumDocFreq()

returns the total number of postings for this field

See Also:
  `Terms.getSumDocFreq()`