Elastichsearch 1.7.3 - Array Field breaks and turns into String

(Christian Weichselbaum) #1

Hi everyone!

I am using elasticsearch to store documents which also contain an array type. This array type works most of the time but at some point elasticsearch takes all it's elements and merges them into a single string.

So far I wasn't able to find a pattern as to when this happens.

(Mark Walkom) #2

Did you map the field correctly? If not, what is the mapping now?

(Christian Weichselbaum) #3

"_accepts" : {
"type" : "string",
"dynamic" : false,
"index" : "not_analyzed",
"store" : true

it's initialized with []

and incremented with: ctx._source._accepts += elem

intermediary solution is now that I reconstruct the array for every new entry.

(David Pilato) #4

Not sure about what you are doing with a full example but may be you want to use nested documents?

So mark your field as nested...

My 2 cents

(system) #5