Description
Under the hood, if a SortedNumericDocValues field is actually single-valued, then Lucene will store it as a single-valued NumericDocValues field and then wrap it to look like a SortedNumericDocValues field when accessed. Therefore, even though the utility classes DoubleField, FloatField, LongField and IntField use SortedNumericDocValues under the hood, these classes are still great when used with single-valued fields. For doubles and floats in particular, the sorted nature of the docValues representation make range queries better. (See #16573 for one such reason)
One big issue when changing to use this for single-valued fields is that you lose the ability to do docValues updates. There should be no issue supporting updates to single-valued SortedNumericDocValues, since ultimately it is a wrapped NumericDocValues (which supports updates).
Description
Under the hood, if a
SortedNumericDocValuesfield is actually single-valued, then Lucene will store it as a single-valuedNumericDocValuesfield and then wrap it to look like a SortedNumericDocValues field when accessed. Therefore, even though the utility classesDoubleField,FloatField,LongFieldandIntFielduseSortedNumericDocValuesunder the hood, these classes are still great when used with single-valued fields. For doubles and floats in particular, the sorted nature of the docValues representation make range queries better. (See #16573 for one such reason)One big issue when changing to use this for single-valued fields is that you lose the ability to do docValues updates. There should be no issue supporting updates to single-valued
SortedNumericDocValues, since ultimately it is a wrappedNumericDocValues(which supports updates).