Source() and doc() disparity in a AbstractDoubleSearchScript

(eddie) #1

Hi all,

We have having some issues with differences between source() and doc() in a
search script. We're running 0.90.2 with the following mapping

mappings: {

  • features: {
    • properties: {
    • id: {
      • type: integer
    • histogram: {
      • type: integer


Where histogram is an array. Assume the index contains the following three


In the search script, when we attempt to retrieve these histograms, I
noticed the following disparity between doc() and source()

doc source

[1,2,3,4,5] [1,2,3,4,5]
[1,2] [1,1,2,2,2]
[3] [3,3,3,3,3]

So in the doc it seems like we are getting the set of the array rather than
the array. I'm retrieving histogram in the following manner:

source: List histogram = (List) source().get("histogram");

doc: List histogram = (List) ((ScriptDocValues)
It would be much appreciated if anyone can help explain why this is


  • eddie

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

(system) #2