# How can i sort by heat?

**URL:** <https://discuss.elastic.co/t/how-can-i-sort-by-heat/144462>\
**Category:** Elasticsearch\
**Created:** [August 15, 2018, 7:21am UTC](https://discuss.elastic.co/t/how-can-i-sort-by-heat/144462 "2018-08-15T07:21:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aimerwhy](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@aimerwhy](https://discuss.elastic.co/u/aimerwhy)\
**Post date:** [August 15, 2018, 7:21am UTC](https://discuss.elastic.co/t/how-can-i-sort-by-heat/144462/1 "2018-08-15T07:21:40Z")

</div>

I want to customize the search results，which sort it by heat.  
Heat means click rate,the more time of click rate,the higher heat.  
And then the higher the click rate, the higher the ranking about the search results.  
Anyone has any idea?  
thanks  
ES version is 6.3.0

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [August 15, 2018, 10:01am UTC](https://discuss.elastic.co/t/how-can-i-sort-by-heat/144462/2 "2018-08-15T10:01:37Z")

</div>

You'll need to store "heat" as a field on docs and use something like [function score query](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html) to blend the relevance score of the document with the boost provided by the heat field.

Probably not very efficient to increment the `heat` field every time a doc ends up in the top results either. Batch up search matches in a seperate file/index and apply any "heat" updates in a batch process.

---

<div class="post-metadata">

**Author:** ![aimerwhy](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@aimerwhy](https://discuss.elastic.co/u/aimerwhy)\
**Post date:** [August 17, 2018, 1:54am UTC](https://discuss.elastic.co/t/how-can-i-sort-by-heat/144462/3 "2018-08-17T01:54:40Z")

</div>

Thank you for your help!  
we have the similar solution，but we think it is diffcult to implement and is not efficient.  
anyway thank you:heart:

---

<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:** [September 14, 2018, 1:54am UTC](https://discuss.elastic.co/t/how-can-i-sort-by-heat/144462/4 "2018-09-14T01:54:41Z")

</div>

Closed on September 14, 2018, 1:54am UTC

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