# Date range query with another query

**URL:** <https://discuss.elastic.co/t/date-range-query-with-another-query/309515>\
**Category:** Kibana\
**Created:** [July 13, 2022, 8:59am UTC](https://discuss.elastic.co/t/date-range-query-with-another-query/309515 "2022-07-13T08:59:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Krishna\_Sai\_Nag\_G](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krishna_sai_nag_g/32/80467_2.png) [@Krishna\_Sai\_Nag\_G](https://discuss.elastic.co/u/Krishna_Sai_Nag_G)\
**Post date:** [July 13, 2022, 8:59am UTC](https://discuss.elastic.co/t/date-range-query-with-another-query/309515/1 "2022-07-13T08:59:23Z")

</div>

I have 2 queries like this and i have to apply date range filter, is it possible to merge the 2 queries, i am applying search on the same index in 2 queries.

* * *

first query

```auto
GET index_1/_search
{
  "_source": ["file.filename"], 
  "query": {
    "range": {
      "publication_datetime_converted": {
        "time_zone": "+01:00",        
        "gte": "2022-05-30 00:00:00", 
        "lte": "2022-07-01 00:00:00"
      }
    }
  }
}

```

* * *

second query

```auto
GET index_1/_search
{
		"size": 4000,
		"sort": [
    { "file.filename": "asc" }],
		"_source": ["file.filename"],
		"query": {
			"bool": {
				"must": [{
					"match": {
						"content": {
							"query": "rohit",
							"operator": "and"
						}
					}
				}, {
					"match": {
						"content": {
							"query": "kohli",
							"operator": "and"
						}
					}
				}, {
					"match": {
						"content": {
							"query": "raina",
							"operator": "and"
						}
					}
				}, 
				{
					"match": {
						"content": {
							"query": "dhoni"
						}
					}
				}
				]
			}
		},
		"highlight": {
			"fields": {
				"content": {}
			}
		}
	}

```

---

<div class="post-metadata">

**Author:** ![LeeDr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leedr/32/9289_2.png) [@LeeDr](https://discuss.elastic.co/u/LeeDr)\
**Post date:** [July 15, 2022, 9:11pm UTC](https://discuss.elastic.co/t/date-range-query-with-another-query/309515/2 "2022-07-15T21:11:21Z")

</div>

Hi Krishna,

If you really want help on Elasticsearch queries it would be best to ask a question in that section of this forum.

Did you try doing the query you need in Discover?

Regards,  
Lee

---

<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:** [August 12, 2022, 9:12pm UTC](https://discuss.elastic.co/t/date-range-query-with-another-query/309515/3 "2022-08-12T21:12:04Z")

</div>

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