# How to retrieve results with certain amount of hits

**URL:** <https://discuss.elastic.co/t/how-to-retrieve-results-with-certain-amount-of-hits/295360>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-searchable-snapshots\
**Created:** [January 25, 2022, 2:37pm UTC](https://discuss.elastic.co/t/how-to-retrieve-results-with-certain-amount-of-hits/295360 "2022-01-25T14:37:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Almog\_Wertzberger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/almog_wertzberger/32/100835_2.png) [@Almog\_Wertzberger](https://discuss.elastic.co/u/Almog_Wertzberger)\
**Post date:** [January 25, 2022, 2:37pm UTC](https://discuss.elastic.co/t/how-to-retrieve-results-with-certain-amount-of-hits/295360/1 "2022-01-25T14:37:39Z")

</div>

Hi,  
Having this query for example:

```auto
GET person_group/_search
{
 "query": {
   "bool": {
     "filter": [
       
       {
         "exists": {
           
           "field": "educations"
           
         }
         
       },
       {
         "exists": {
           "field": "experience",
          
         }
         
       }
     ]
   }
 },
 "size": 200,
 "sort": [
   {
     "lastModifiedDate": {
       "order": "desc"
     }
   }
 ]
}

```

How can I specify the amount of "experience" and the amount of "education"? (both has their own hits inside)  
furthermore- How can I specify a range of required hits or a minimum of required hits?

---

<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:** [February 22, 2022, 2:38pm UTC](https://discuss.elastic.co/t/how-to-retrieve-results-with-certain-amount-of-hits/295360/2 "2022-02-22T14:38:36Z")

</div>

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