# Content match in elasticsearch query over date range

**URL:** <https://discuss.elastic.co/t/content-match-in-elasticsearch-query-over-date-range/302478>\
**Category:** Elasticsearch\
**Created:** [April 15, 2022, 3:56am UTC](https://discuss.elastic.co/t/content-match-in-elasticsearch-query-over-date-range/302478 "2022-04-15T03:56:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![stecino](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@stecino](https://discuss.elastic.co/u/stecino)\
**Post date:** [April 15, 2022, 3:56am UTC](https://discuss.elastic.co/t/content-match-in-elasticsearch-query-over-date-range/302478/1 "2022-04-15T03:56:38Z")

</div>

Hello,

Trying to execute query over an index for the last 5 minutes, where message field contain word IIOP\_CLEAR\_TEXT. Would like to get all the results, via pagination as well using 10000 records per page. How can this be done via curl?

---

<div class="post-metadata">

**Author:** ![anime\_lover](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anime_lover/32/100265_2.png) [@anime\_lover](https://discuss.elastic.co/u/anime_lover)\
**Post date:** [April 15, 2022, 4:38am UTC](https://discuss.elastic.co/t/content-match-in-elasticsearch-query-over-date-range/302478/2 "2022-04-15T04:38:42Z")

</div>

I think this query might help you out.

```auto
curl -XGET "http://youresurl:9200/index_name/_search" -H 'Content-Type: application/json' -d'{ 
 "size": 10000, 
 "from": 0,  
 "query": {   
 "bool": {
          "must": [      
                     { 
                       "match": {  
                                "message": "IIOP_CLEAR_TEXT"        
                                }
                           }
                      ]
                }
        }
}'

```

---

<div class="post-metadata">

**Author:** ![stecino](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@stecino](https://discuss.elastic.co/u/stecino)\
**Post date:** [April 19, 2022, 5:47pm UTC](https://discuss.elastic.co/t/content-match-in-elasticsearch-query-over-date-range/302478/3 "2022-04-19T17:47:52Z")

</div>

Thanks for the reply, how would I include date range into this?

---

<div class="post-metadata">

**Author:** ![stecino](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@stecino](https://discuss.elastic.co/u/stecino)\
**Post date:** [April 19, 2022, 6:02pm UTC](https://discuss.elastic.co/t/content-match-in-elasticsearch-query-over-date-range/302478/4 "2022-04-19T18:02:50Z")

</div>

Never mind, used filter, to apply the range, thanks alot again for the help

---

<div class="post-metadata">

**Author:** ![stecino](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@stecino](https://discuss.elastic.co/u/stecino)\
**Post date:** [April 19, 2022, 6:19pm UTC](https://discuss.elastic.co/t/content-match-in-elasticsearch-query-over-date-range/302478/5 "2022-04-19T18:19:17Z")

</div>

Actually, if I wanted to do multiple matches with or operator, would I change must, if so to what would it be? I will have to match in the array in that case.

---

<div class="post-metadata">

**Author:** ![anime\_lover](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anime_lover/32/100265_2.png) [@anime\_lover](https://discuss.elastic.co/u/anime_lover)\
**Post date:** [April 20, 2022, 5:14am UTC](https://discuss.elastic.co/t/content-match-in-elasticsearch-query-over-date-range/302478/7 "2022-04-20T05:14:24Z")

</div>

I didn't understand what exactly you meant but i hope this might help you.

```auto
GET /my-index-000001/_search
{
  "size": 10000,
  "from": 0,
  "query": {
   "multi_match": {
     "query": "IIOP_CLEAR_TEXT",
     "fields": ["title","content","field_name"],
     "operator": "or"
   }
  }
}

```

---

<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:** [May 18, 2022, 5:15am UTC](https://discuss.elastic.co/t/content-match-in-elasticsearch-query-over-date-range/302478/8 "2022-05-18T05:15:04Z")

</div>

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