How do I use the _id field in Painless?


(Tal Weiss) #1

How do I access the _id field of a document in the Painless scripting language?

Every time I try something like this:

doc['_id'] + "/" + doc['site_code'].value
doc['_index'] + "/" + doc['site_code'].value
ctx.index + "/" + doc['sitecode'].value

All shards crash???

Not very friendly. I'm trying a scripted filed via Kibana with latest hosting plan.


(Tal Weiss) #2

so I managed to access the _id via the _uid field, and applying .substring()


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.