Manipulate source data using script

Hi All,

I want to check if there is a way to manipulate the response returned by elasticsearch.
For ex: Below is the response and I would like replace the docdate field value based on user time zone. I don't want it as separate script fields.

{
"took" : 2,
"timed_out" : false,
"_shards" : {
"total" : 3,
"successful" : 3,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : null,
"hits" : [
{
"_source" : {
"dateaccepted" : "0001-01-01T00:00:00",
"datecreated" : "2019-08-22T15:10:45",
"docdate" : "2019-08-22T15:50:05.577",
}
}
]
}
}

The _source is always the exact data that has been inserted when storing the document, it is not modified.

Thanks Alexander!

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