Package org.apache.lucene.search
Class NumericFieldStats
java.lang.Object
org.apache.lucene.search.NumericFieldStats
Utility class for retrieving global numeric field statistics from index metadata structures,
without accessing individual documents. It probes
PointValues first and falls back to
DocValuesSkipper. Returns null when neither structure is available for the field.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordHolds the global statistics for a numeric field. -
Method Summary
Modifier and TypeMethodDescriptionstatic NumericFieldStats.StatsgetStats(IndexReader reader, String field) Returns the global statistics for the given numeric field across all segments.
-
Method Details
-
getStats
Returns the global statistics for the given numeric field across all segments. ProbesPointValuesfirst; if unavailable, falls back toDocValuesSkipper.- Parameters:
reader- theIndexReaderto queryfield- the name of the numeric field- Returns:
- a
NumericFieldStats.Statscontaining the global min, max, and doc count, ornullif neitherPointValuesnorDocValuesSkipperare available for the field - Throws:
IOException- if an I/O error occurs
-