# Best Possible way to implement two words search

**URL:** <https://discuss.elastic.co/t/best-possible-way-to-implement-two-words-search/256837>\
**Category:** Elasticsearch\
**Created:** [November 27, 2020, 5:37am UTC](https://discuss.elastic.co/t/best-possible-way-to-implement-two-words-search/256837 "2020-11-27T05:37:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vipul\_Sharma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vipul_sharma/32/45741_2.png) [@Vipul\_Sharma](https://discuss.elastic.co/u/Vipul_Sharma)\
**Post date:** [November 27, 2020, 5:37am UTC](https://discuss.elastic.co/t/best-possible-way-to-implement-two-words-search/256837/1 "2020-11-27T05:37:39Z")

</div>

Hi,

I was wondering what would be the best possible way to write a ES query to fetch the documents in a way that  
if the search query is like: 'elastic search'

Then on the top it will show all the documents with 'elastic search' in them  
then on the last it will show documents having 'elastic' or 'search' in them.

is that possible in a single match query?

---

<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:** [December 25, 2020, 5:37am UTC](https://discuss.elastic.co/t/best-possible-way-to-implement-two-words-search/256837/2 "2020-12-25T05:37:41Z")

</div>

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