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
In self-defined SearchScript, I use ((ScriptDocValues<List>) getDoc().get(field)).get(0) returns 0.1 , but not 0.5. Why ? How can I retrieve the original double array, e.g. [0.5, 0.1, 0.3], not [0.1, 0.3, 0.5] ?
Thanks !
The text was updated successfully, but these errors were encountered:
We prefer to use github for bug reports or feature requests, for more general questions or support please use our discussion forums at http://discuss.elastic.co.
Multivalued docvalues are stored as sorted at the lucene level, so lose their original ordering when indexed. If you need to preserve the ordering, you could try encoding the values in a binary field and retrieving them from BinaryDocValues at search time, or storing them as separate fields.
Thank you !
With cmd curl -XGET http://<ip>:<port>/<index>/<type>/<ID> I got the 'feature_value' in original order. So I don't think docvalues stored as sorted at the lucene level.
mappping:
{ "settings" : { "index" : { "number_of_shards" : 1, "number_of_replicas" : 0 } }, "mappings": { "obj_type": { "properties": { "feature_value": { "type": "double" }, } } } }
doc:
{"feature_value":[0.5, 0.1, 0.3]}
In self-defined SearchScript, I use ((ScriptDocValues<List>) getDoc().get(field)).get(0) returns 0.1 , but not 0.5. Why ? How can I retrieve the original double array, e.g. [0.5, 0.1, 0.3], not [0.1, 0.3, 0.5] ?
Thanks !
The text was updated successfully, but these errors were encountered: