# Sort results based on the number of highlights?

**URL:** <https://discuss.elastic.co/t/sort-results-based-on-the-number-of-highlights/233061>\
**Category:** Elasticsearch\
**Created:** [May 18, 2020, 8:21am UTC](https://discuss.elastic.co/t/sort-results-based-on-the-number-of-highlights/233061 "2020-05-18T08:21:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shAkur](https://avatars.discourse-cdn.com/v4/letter/s/a88e4f/32.png) [@shAkur](https://discuss.elastic.co/u/shAkur)\
**Post date:** [May 18, 2020, 8:21am UTC](https://discuss.elastic.co/t/sort-results-based-on-the-number-of-highlights/233061/1 "2020-05-18T08:21:07Z")

</div>

Is there a way to sort the search results based on the number of highlighted words per document?

I'm using the highlight feature on a multi\_match search and I want to have the results with the most matching highlights on top of the list. Is it possible?

---

<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:** [June 15, 2020, 8:21am UTC](https://discuss.elastic.co/t/sort-results-based-on-the-number-of-highlights/233061/2 "2020-06-15T08:21:20Z")

</div>

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