Post processing query resut

Hi All,
Is there any way to post process the result of a query result. For example, If I have a field called "distance" in the document which is stored in "meters", the result should give the distance in "Kilometer". Basically I should divide the value by 1000 and display it as part of result.

Thanks,

Have a look at script fields.

https://www.elastic.co/guide/en/elasticsearch/reference/2.1/search-request-script-fields.html

Hi Magnus,
Thank you for your reply. I tried this. But this create the modified field under fields object. Is there any way to modify the content inside source itself?

What about https://www.elastic.co/guide/en/elasticsearch/reference/2.1/docs-update.html#_scripted_updates

1 Like