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
From the documentation the shown way to get a field value is to use something like the following on a returned document.
err = match.VisitStoredFields(func(field string, value []byte) bool {
if field == "_id" {
fmt.Printf("match: %s\n", string(value))
}
return true
})
However in some cases I only want to pull a single value from the document. I tried a combination of doc.LoadDocumentValues and doc.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.
The text was updated successfully, but these errors were encountered:
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.
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.The text was updated successfully, but these errors were encountered: