I hope someone can explain me why I'm having this issue: I want to validate an ES (in version 7.4) query before launch it, every thing works fine if the query has no aggs clause but, if the query has aggs, ES says it's a no valid query, what is driving my crazy is the query works fine in ES but at the same time ES tells me it's not a valid query.
I think is because ES do not validate queries with aggs but I would love to "be sure", I've read the documentation and I found no clue.
Thanks a lot.
This is an example of ES query I want to validate
"query": {
"bool": {
"must": [
{
"match_phrase": {
"probe_id": {
"query": "probe id"
}
}
}
]
}
},
"aggs": {
"agg_by_hours": {
"terms": {
"field": "hours",
"size": 24,
"order": {
"_term": "desc"
}
}
}
}
}```