Closed michaeljs1990 closed 3 years ago
So, the reasoning behind this is that all of the stored fields are encoded as a single compressed entry. The cost to retrieve a single value is essentially the cost to retrieve any value, thus the API takes the form that it does. This is similar to Lucene, which (last time I checked) had a similar API.
We could offer an API to access a single value, but depending on how it was used, it could be even more expensive.
That makes more sense to me my only concern was that I was doing more work than needed to retrieve a single value.
From the documentation the shown way to get a field value is to use something like the following on a returned document.
However in some cases I only want to pull a single value from the document. I tried a combination of
doc.LoadDocumentValues
anddoc.DocValues
however it doesn't seem that I can retrieve a single value from a given document at present. This is using the in memory index currently.