You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add maxValueCount to DocValuesSkipper metadata #15794
Currently, if a consumer of a numeric or ordinal-based docvalues iterator wants to know if the field is multivalued, then they need to access it via DocValues.getSortedXXX and then check to see if the returned iterator can be unwrapped to a singleton. This is fragile, and not necessarily supported by Codecs. We could build more consistent checks by storing a global maxValueCount entry on DocValuesSkipper. A singleton check can then be done by seeing if the global maxValueCount is equal to 1.
Reacted by Martijn van Groningen, gaobinlong and Prithvi S
A singleton check can then be done by seeing if the global maxValueCount is equal to 1.
Would it also make sense to also support maxValueCount at the doc value skipper entry level? Then queries know from minDocId to maxDocId are single valued or not?
Awesome, we really want this feature, in our use case, we want to know if a docvalues field is multi-valued, then convert the same string field's format to array for each hit doc in the search response.
then they need to access it via DocValues.getSortedXXX and then check to see if the returned iterator can be unwrapped to a singleton.
I also found this to be a somewhat hacky way of determining whether a field is multi-valued when I first looked at it.
So makes sense to add maxValueCount entry on DocValuesSkipper.
I can pick this up until unless someone is already working on it.
Activity
martijnvg commentedon Mar 4, 2026
Would it also make sense to also support maxValueCount at the doc value skipper entry level? Then queries know from minDocId to maxDocId are single valued or not?
gaobinlong commentedon Mar 6, 2026
Awesome, we really want this feature, in our use case, we want to know if a docvalues field is multi-valued, then convert the same string field's format to array for each hit doc in the search response.
sgup432 commentedon Mar 6, 2026
I also found this to be a somewhat hacky way of determining whether a field is multi-valued when I first looked at it.
So makes sense to add maxValueCount entry on DocValuesSkipper.
I can pick this up until unless someone is already working on it.