# Post processing query resut

**URL:** <https://discuss.elastic.co/t/post-processing-query-resut/40664>\
**Category:** Elasticsearch\
**Created:** [February 1, 2016, 8:28pm UTC](https://discuss.elastic.co/t/post-processing-query-resut/40664 "2016-02-01T20:28:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pradeep\_Gowda](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@Pradeep\_Gowda](https://discuss.elastic.co/u/Pradeep_Gowda)\
**Post date:** [February 1, 2016, 8:28pm UTC](https://discuss.elastic.co/t/post-processing-query-resut/40664/1 "2016-02-01T20:28:39Z")

</div>

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,

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [February 1, 2016, 8:32pm UTC](https://discuss.elastic.co/t/post-processing-query-resut/40664/2 "2016-02-01T20:32:19Z")

</div>

Have a look at script fields.

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

---

<div class="post-metadata">

**Author:** ![Pradeep\_Gowda](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@Pradeep\_Gowda](https://discuss.elastic.co/u/Pradeep_Gowda)\
**Post date:** [February 1, 2016, 8:38pm UTC](https://discuss.elastic.co/t/post-processing-query-resut/40664/3 "2016-02-01T20:38:19Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 1, 2016, 9:02pm UTC](https://discuss.elastic.co/t/post-processing-query-resut/40664/4 "2016-02-01T21:02:12Z")

</div>

What about [https://www.elastic.co/guide/en/elasticsearch/reference/2.1/docs-update.html#\_scripted\_updates](https://www.elastic.co/guide/en/elasticsearch/reference/2.1/docs-update.html#_scripted_updates)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:19pm UTC](https://discuss.elastic.co/t/post-processing-query-resut/40664/5 "2017-07-05T23:19:51Z")

</div>


