# How to guarantee percentage of result in multi\_match search

**URL:** <https://discuss.elastic.co/t/how-to-guarantee-percentage-of-result-in-multi-match-search/314792>\
**Category:** Elasticsearch\
**Created:** [September 20, 2022, 4:18pm UTC](https://discuss.elastic.co/t/how-to-guarantee-percentage-of-result-in-multi-match-search/314792 "2022-09-20T16:18:14Z")\
**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 20, 2022, 4:18pm UTC](https://discuss.elastic.co/t/how-to-guarantee-percentage-of-result-in-multi-match-search/314792/1 "2022-09-20T16:18:14Z")

</div>

I have a search using multi\_match that returns products from multiple stores

there is a business logic that i need to implement, which is:

ensure that products from certain stores must appear on each pagination (30 items)

i.e. I have two stores that need to have at least 10% of their products on each page

should look like this:  
`store_ids = [5, 6]`

results:  
`[1, 1, 1, 1, 5, 5, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 6, 6 , 1, 1, 1, 1, 1,]`

it depends on the result, that is, on the amount of results it finds

Is there any way to get this result?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 20, 2022, 10:28pm UTC](https://discuss.elastic.co/t/how-to-guarantee-percentage-of-result-in-multi-match-search/314792/2 "2022-09-20T22:28:31Z")

</div>

Not directly from Elasticsearch, no. You will need to run a query and then sort them accordingly in your code.

---

<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 18, 2022, 10:29pm UTC](https://discuss.elastic.co/t/how-to-guarantee-percentage-of-result-in-multi-match-search/314792/3 "2022-10-18T22:29:16Z")

</div>

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