Field value is auto-resorted while being called from scriptFunction()?


in my example, the value of my field "vectors" is an array. the mapping
looks like this.

 "vectors": {        

  "type": "float",

      "index": "not_analyzed"


for example, when I query a document by its id, part of the result might
look like this,

***************** "vectors":[3.2, 1.5, 2.2] **************

I want to use my own score function for termQuery, which is implemented in
a groovy script

however I got this in Groovy....

  doc['vectors'].values[0] = 1.5, doc['vectors'].values[1] = 2.2, ...

How do I fix it to keep the original order ?? such that
doc['vectors'].values[0] = 3.2

I'm very desperate with this scripting now ... help needed !


You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
For more options, visit