Script bug or just me?

Hi everyone.

I'll keep it simple: Scripts in Groovy doesn't work when making iterations on arrays.

The mapping:

{
  "Xxx" : {
    "mappings" : {
      "node" : {
        "properties" : {
          "id" : {
            "type" : "double"
          },
          "searchTags" : {
            "type" : "nested",
            "properties" : {
              "id" : {
                "type" : "double"
              },
              "packages" : {
                "type" : "double"
              }
            }
          }
        }
      }
    }
  }
}

The following scripts are part of a bigger query, I've removed the rest so we can focus on this simple script that fails.
This doesn't work:

return doc['searchTags.packages'].every { it == 1.0 }

but this works:

return doc['searchTags.packages'].count() > 0

All scripts that contains an iteration seems to fail. I'm using Elastic Search 2.2.0.0

I've attached a snippet of the stacktrace.

Hey,

can you try a more recent version of Elasticsearch? You might have hit one of those


--Alex

Hi spinscale,

I think you might be right. I'll try updating and see if it solves my problem.
I'll return with the result in a few hours :).

M.

It worked flawlessly! Upgraded to 2.3.1.0

Thanks for the help.