It looks like ctx._source.context
is an array in your source. So you need to iterate through each value of the array and dereference it by index. So instead of ctx._source.context.data
, you need a loop like:
for (int i = 0; i < ctx._source.context.length; ++i) {
ctx._source.context[i].data
}