Package org.apache.lucene.misc.search
Class DocValuesStats<T>
- java.lang.Object
-
- org.apache.lucene.misc.search.DocValuesStats<T>
-
- Direct Known Subclasses:
DocValuesStats.NumericDocValuesStats,DocValuesStats.SortedDocValuesStats,DocValuesStats.SortedNumericDocValuesStats,DocValuesStats.SortedSetDocValuesStats
public abstract class DocValuesStats<T> extends Object
Holds statistics for a DocValues field.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDocValuesStats.DoubleDocValuesStatsHolds DocValues statistics for a numeric field storingdoublevalues.static classDocValuesStats.LongDocValuesStatsHolds DocValues statistics for a numeric field storinglongvalues.static classDocValuesStats.NumericDocValuesStats<T extends Number>Holds statistics for a numeric DocValues field.static classDocValuesStats.SortedDocValuesStatsHolds statistics for a sorted DocValues field.static classDocValuesStats.SortedDoubleDocValuesStatsHolds DocValues statistics for a sorted-numeric field storingdoublevalues.static classDocValuesStats.SortedLongDocValuesStatsHolds DocValues statistics for a sorted-numeric field storinglongvalues.static classDocValuesStats.SortedNumericDocValuesStats<T extends Number>Holds statistics for a sorted-numeric DocValues field.static classDocValuesStats.SortedSetDocValuesStatsHolds statistics for a sorted-set DocValues field.
-
Constructor Summary
Constructors Modifier Constructor Description protectedDocValuesStats(String field, T initialMin, T initialMax)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intcount()The number of documents which have a value of the field.protected abstract voiddoAccumulate(int count)Called afteraccumulate(int)was processed and verified that the document has a value for the field.Stringfield()The field for which these stats were computed.protected abstract booleanhasValue(int doc)Returns whether the given document has a value for the requested DocValues field.protected abstract booleaninit(LeafReaderContext context)Initializes this object with the given reader context.Tmax()The maximum value of the field.Tmin()The minimum value of the field.intmissing()The number of documents which do not have a value of the field.
-
-
-
Method Detail
-
doAccumulate
protected abstract void doAccumulate(int count) throws IOExceptionCalled afteraccumulate(int)was processed and verified that the document has a value for the field. Implementations should update the statistics based on the value of the current document.- Parameters:
count- the updated number of documents with value for this field.- Throws:
IOException
-
init
protected abstract boolean init(LeafReaderContext context) throws IOException
Initializes this object with the given reader context. Returns whether stats can be computed for this segment (i.e. it does have the requested DocValues field).- Throws:
IOException
-
hasValue
protected abstract boolean hasValue(int doc) throws IOExceptionReturns whether the given document has a value for the requested DocValues field.- Throws:
IOException
-
field
public final String field()
The field for which these stats were computed.
-
count
public final int count()
The number of documents which have a value of the field.
-
missing
public final int missing()
The number of documents which do not have a value of the field.
-
-