One may be wondering: what happens in Solr at retrieval time when
- fl contains only stored values
- fl contains only docValues (stored=false)
- fl contains a mix of stored and docValues fields?
Being the two options not exclusive, in the first two cases above we assume we have one option enabled and the other disabled. With that assumption, case 1 and 2 are easy because stored and docValues fields are two disjoint set: in the first case Solr will use the stored values while in the second scenario will make use of the docValues structure.
The third case is a little bit tricky because, as said above, those two options could be both enabled (i.e. stored=”true” docValues=”true”). Here. we have to make a distinction before and after Solr 7 because an optimisation that has been introduced.
Actually, more than the optimisation itself, the new RetrieveFieldOptimizer class in Solr 7 created a centralised point of responsibility where further enhancements could be implemented in the next future.
Prior to Solr 7, for each SolrDocument instance to be returned in the results the org.apache.solr.response.DocsStreamer class, actual responsible for fetching fields values, executes a sequential scan of
- stored fields (i.e. fields marked as “stored” regardless their docValues settings)
- docValues enabled fields
Here’s a snippet from that class:
christophe CERQUEIRA
June 25, 2020thx for you interesting article , i have a question ; can you explain me the option DocValuesFormat and how to Defines a custom DocValuesFormat = “Disk” , because my facetting requests have an out of memory. I don’t know that is the solution to force solr user disc when facetting request are excuted