public class CollectionStatistics extends Object
This class holds statistics across all documents for scoring purposes:
maxDoc(): number of documents.
docCount(): number of documents that contain this field.
sumDocFreq(): number of postings-list entries.
sumTotalTermFreq(): number of tokens.
The following conditions are always true:
Values may include statistics on deleted documents that have not yet been merged away.
Be careful when performing calculations on these values because they are represented
as 64-bit integer values, you may need to cast to
double for your use.
|Constructor and Description|
Creates statistics instance for a collection (field).
|Modifier and Type||Method and Description|
The total number of documents that have at least one term for this field.
The field's name.
The total number of documents, regardless of whether they all contain values for this field.
The total number of posting list entries for this field.
The total number of tokens for this field.
public CollectionStatistics(String field, long maxDoc, long docCount, long sumTotalTermFreq, long sumDocFreq)
field- Field's name
maxDoc- total number of documents.
docCount- number of documents containing the field.
sumTotalTermFreq- number of tokens in the field.
sumDocFreq- number of postings list entries for the field.
maxDocis negative or zero.
docCountis negative or zero.
docCountis more than
sumDocFreqis less than
sumTotalTermFreqis less than
public final String field()
This value is never
public final long maxDoc()
This value is always a positive number.
public final long docCount()
This value is always a positive number, and never
public final long sumTotalTermFreq()
TermStatistics.totalTermFreq()across all terms. It is also the sum of each document's field length across all documents.
This value is always a positive number, and always at least
public final long sumDocFreq()
TermStatistics.docFreq()across all terms. It is also the sum of each document's unique term count for this field across all documents.
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.