# Prioritise a "should" query

**URL:** <https://discuss.elastic.co/t/prioritise-a-should-query/259907>\
**Category:** Elasticsearch\
**Created:** [December 30, 2020, 6:19pm UTC](https://discuss.elastic.co/t/prioritise-a-should-query/259907 "2020-12-30T18:19:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ivanibash](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ivanibash/32/60905_2.png) [@ivanibash](https://discuss.elastic.co/u/ivanibash)\
**Post date:** [December 30, 2020, 6:19pm UTC](https://discuss.elastic.co/t/prioritise-a-should-query/259907/1 "2020-12-30T18:19:02Z")

</div>

I have a should query like

```
query: {
    bool: {
        should: [
                 {
                     match: {
                       name: value,
                     }
                 },
                 { 
                    match: {
                        number: value2
                    }
                 }
              ]
    }
}

```

I want to get 200 results. Out of those 200, I want as many "number" matches as I can get, with the remainder being "name" matches. I also know that the number of "number" matches will typically be small (1-10).

Is there a way for me to prioritise the number matches, to make sure I'm getting as many as I can before looking at name matches? I know how to achieve it using msearch, but was wondering if I can do it in one query. Thanks.

---

<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:** [January 27, 2021, 6:19pm UTC](https://discuss.elastic.co/t/prioritise-a-should-query/259907/2 "2021-01-27T18:19:16Z")

</div>

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