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
Holds statistics for a DocValues field.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Holds DocValues statistics for a numeric field storingdouble
values.static final class
Holds DocValues statistics for a numeric field storinglong
values.static class
DocValuesStats.NumericDocValuesStats<T extends Number>
Holds statistics for a numeric DocValues field.static class
Holds statistics for a sorted DocValues field.static final class
Holds DocValues statistics for a sorted-numeric field storingdouble
values.static final class
Holds DocValues statistics for a sorted-numeric field storinglong
values.static class
Holds statistics for a sorted-numeric DocValues field.static class
Holds statistics for a sorted-set DocValues field. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal int
count()
The number of documents which have a value of the field.protected abstract void
doAccumulate
(int count) Called afteraccumulate(int)
was processed and verified that the document has a value for the field.final String
field()
The field for which these stats were computed.protected abstract boolean
hasValue
(int doc) Returns whether the given document has a value for the requested DocValues field.protected abstract boolean
init
(LeafReaderContext context) Initializes this object with the given reader context.final T
max()
The maximum value of the field.final T
min()
The minimum value of the field.final int
missing()
The number of documents which do not have a value of the field.
-
Field Details
-
field
-
min
-
max
-
-
Constructor Details
-
DocValuesStats
-
-
Method Details
-
doAccumulate
Called 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
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
Returns whether the given document has a value for the requested DocValues field.- Throws:
IOException
-
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. -
min
The minimum value of the field. Undefined whencount()
is zero. -
max
The maximum value of the field. Undefined whencount()
is zero.
-