# How to return exact match result first then other matches?

**URL:** <https://discuss.elastic.co/t/how-to-return-exact-match-result-first-then-other-matches/309452>\
**Category:** Elasticsearch\
**Created:** [July 12, 2022, 6:36pm UTC](https://discuss.elastic.co/t/how-to-return-exact-match-result-first-then-other-matches/309452 "2022-07-12T18:36:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jake\_Wong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jake_wong/32/98140_2.png) [@Jake\_Wong](https://discuss.elastic.co/u/Jake_Wong)\
**Post date:** [July 12, 2022, 6:36pm UTC](https://discuss.elastic.co/t/how-to-return-exact-match-result-first-then-other-matches/309452/1 "2022-07-12T18:36:29Z")

</div>

I am newbie to elastic. I have data in elasticsearch, with field post\_title :

- Chocolate
- Hot
- Homemade

I expect to get 'ho' (exact match) as first result when I search 'ho'

like this:

1. Homemade
2. Hot
3. chocolate

I have tried "match", "match\_phrase", "prefix" and "wildcard" in my query, but it doesn't work.

What should I do to put the exact match into first result?

---

<div class="post-metadata">

**Author:** ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)\
**Post date:** [July 13, 2022, 2:06pm UTC](https://discuss.elastic.co/t/how-to-return-exact-match-result-first-then-other-matches/309452/2 "2022-07-13T14:06:09Z")

</div>

Could you share the mappings of the index and your tried queries?

---

<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:** [August 10, 2022, 2:06pm UTC](https://discuss.elastic.co/t/how-to-return-exact-match-result-first-then-other-matches/309452/3 "2022-08-10T14:06:20Z")

</div>

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