SYEDMDSAAD opened a new pull request, #15752:
URL: https://github.com/apache/lucene/pull/15752
This patch introduces FieldMinMax, a unified API to retrieve global
minimum and maximum numeric values for a field across an IndexReader.
Currently Lucene exposes two different mechanisms:
* PointValues.getMinPackedValue / getMaxPackedValue
- returns null when no values exist
* DocValuesSkipper.globalMinValue / globalMaxValue
- returns sentinel values when metadata is unavailable
This forces callers to understand internal storage details and manually
filter invalid values.
FieldMinMax abstracts over both implementations and provides consistent
behavior:
* Uses PointValues when available (accurate index statistics)
* Falls back to DocValuesSkipper when metadata exists
* Falls back to scanning NumericDocValues when skipper metadata is absent
* Returns null when no values exist
This prevents sentinel leakage and simplifies caller logic.
Tests cover:
- missing field
- point values
- doc values
- mixed segments
- empty segments
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]