Post processing query resut


(Nemo) #1

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,


(Magnus B├Ąck) #2

Have a look at script fields.

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


(Nemo) #3

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?


(Mark Walkom) #4

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


(system) #5