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
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
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": {}
}
}
}