# How to display exact match and variations after

**URL:** <https://discuss.elastic.co/t/how-to-display-exact-match-and-variations-after/315394>\
**Category:** Elasticsearch\
**Created:** [September 28, 2022, 5:32pm UTC](https://discuss.elastic.co/t/how-to-display-exact-match-and-variations-after/315394 "2022-09-28T17:32:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guilherme\_Mello](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guilherme_mello/32/100083_2.png) [@Guilherme\_Mello](https://discuss.elastic.co/u/Guilherme_Mello)\
**Post date:** [September 28, 2022, 5:32pm UTC](https://discuss.elastic.co/t/how-to-display-exact-match-and-variations-after/315394/1 "2022-09-28T17:32:43Z")

</div>

How can I display first the exact match and search variations after?  
example:

query: all star

results:  
all star red (exact)  
all star blue (exact)  
all star long (exact)  
dress all red (partial)  
shoes star (partial)

I tried to use should and must but it doesn't work.  
The results are mixed.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 28, 2022, 5:47pm UTC](https://discuss.elastic.co/t/how-to-display-exact-match-and-variations-after/315394/2 "2022-09-28T17:47:34Z")

</div>

I shared a way to combine all this. Have a look at this example:

> <https://gist.github.com/dadoonet/5179ee72ecbf08f12f53d4bda1b76bab>

Specifically [those lines](https://gist.github.com/dadoonet/5179ee72ecbf08f12f53d4bda1b76bab#file-search_kibana_console-txt-L374-L469).

---

<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:** [October 26, 2022, 5:47pm UTC](https://discuss.elastic.co/t/how-to-display-exact-match-and-variations-after/315394/3 "2022-10-26T17:47:47Z")

</div>

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