Access key value pair from the index using document fields in a script

I am trying to access a nested field the form of a map (basically key value
pairs) using document fields inside a script. But I am only able to get the
values and not the names Is that possible ? I looked at the code
for ScriptDocValues and it looks like it supports only four
types Longs, Doubles, GeoPoints and Strings. Here is the format i am trying
to get

"nested_field_name": {
"field_name1": field_value (number),
"field_name2": field_value (number),
"field_name3": field_value (number)

Is there any way i can access a key value pair using document fields
(doc[nested_field_name] format ) ?


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