Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Solr uses UninvertingReader to expose DocValues on fields that don't have them, but do have indexed fields that can be inverted via the FieldCache. It has an internal constructor that takes the input LeafReader and a mapping of field name to UninvertingReader.Type. It builds a new FieldInfos that have fields reflecting DocValues. There are two things I'd like to improve here:
- make this constructor private and instead insist you use a new wrap() method that has the opportunity to return the input if there is nothing to do. Effectively the logic today would move into this wrap method, and the current constructor would be dead simple, and would take the FieldInfos.
- Do not create a new FieldInfo object if the existing field is suitable (it's DocValuesType can stay the same). The savings here can really add up on machines with many indexes & segments. This is in fact what motivated the patch.