# If no result use next query

**URL:** <https://discuss.elastic.co/t/if-no-result-use-next-query/39968>\
**Category:** Elasticsearch\
**Created:** [January 24, 2016, 7:51am UTC](https://discuss.elastic.co/t/if-no-result-use-next-query/39968 "2016-01-24T07:51:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![slowdriver](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@slowdriver](https://discuss.elastic.co/u/slowdriver)\
**Post date:** [January 24, 2016, 7:51am UTC](https://discuss.elastic.co/t/if-no-result-use-next-query/39968/1 "2016-01-24T07:51:35Z")

</div>

Hay!  
I looking for a solution for this problem:

If my first query have no result use next query, else have to give back only the hits from the first query.

My code  
`"query": { "bool": { "should": [{ "match": { "model": { "query": "63090300", "boost": "5" } } }, { "match": { "ean": { "query": "63090300" } } }] } }`

In this example the hits are 2 (model matches, ean matches). But i want only the hit from the model, not ean.

Thanks in advance for help!!!

---

<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:** [July 5, 2017, 11:22pm UTC](https://discuss.elastic.co/t/if-no-result-use-next-query/39968/2 "2017-07-05T23:22:08Z")

</div>

Closed on July 5, 2017, 11:22pm UTC


