# How does search result always show on TOP of popularity search

**URL:** <https://discuss.elastic.co/t/how-does-search-result-always-show-on-top-of-popularity-search/129960>\
**Category:** Elasticsearch\
**Created:** [April 29, 2018, 2:24pm UTC](https://discuss.elastic.co/t/how-does-search-result-always-show-on-top-of-popularity-search/129960 "2018-04-29T14:24:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![woon\_minika](https://avatars.discourse-cdn.com/v4/letter/w/f475e1/32.png) [@woon\_minika](https://discuss.elastic.co/u/woon_minika)\
**Post date:** [April 29, 2018, 2:24pm UTC](https://discuss.elastic.co/t/how-does-search-result-always-show-on-top-of-popularity-search/129960/1 "2018-04-29T14:24:51Z")

</div>

I want to have the most matched result show and order by popularity of what people search, how should I do?

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [April 30, 2018, 4:24pm UTC](https://discuss.elastic.co/t/how-does-search-result-always-show-on-top-of-popularity-search/129960/2 "2018-04-30T16:24:50Z")

</div>

You'll need to save the popularity value somehow, like a `num_views` field on the documents. Then you can include that field as part of the scoring, or order by `num_views`

---

<div class="post-metadata">

**Author:** ![woon\_minika](https://avatars.discourse-cdn.com/v4/letter/w/f475e1/32.png) [@woon\_minika](https://discuss.elastic.co/u/woon_minika)\
**Post date:** [May 1, 2018, 2:38am UTC](https://discuss.elastic.co/t/how-does-search-result-always-show-on-top-of-popularity-search/129960/3 "2018-05-01T02:38:34Z")

</div>

No, i don't order it, i need it more dynamically.

Did you mean customise a function score? Do you have any example ?

---

<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:** [May 29, 2018, 2:38am UTC](https://discuss.elastic.co/t/how-does-search-result-always-show-on-top-of-popularity-search/129960/4 "2018-05-29T02:38:42Z")

</div>

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