hello , I have been trying to join those two searches , but I didnt managed .
I want to do this -
SELECT user-data WHERE company.id = 1 AND timestamp BETWEEEN 2023-05-04 - 2023-06-05
// RESULT 100
GET /user-data/_search
{
"query": {
"nested": {
"path": "company",
"query": {
"bool": {
"must": [
{ "match": { "company.id": 1 } }
]
}
}
}
}
}
// RESULT 20
GET /user-data/_search
{
"query": {
"bool": {
"must": [
{ "range": {
"timestamp": {
"gte": "2023-05-04",
"lte": "2023-06-05"
}
}
}
]
}
}
}