Description
Java API client version
8.15.0
Java version
21.0.3
Elasticsearch Version
8.15.0
Problem description
Hi there,
I have a query that works perfectly in Elastic 8.13.1, but now I receive the following error:
[es/search] failed: [x_content_parse_exception] [1:391] [bool] failed to parse field [must]
However, when I print my query in the terminal and execute it in the Elastic Dev Tools, it works fine:
{ "query": { "bool": { "must": [ { "range": { "@timestamp": { "gte": "2024-08-13 21:07:00", "lte": "2024-08-16 21:07:00", "format": "yyyy-MM-dd HH:mm:ss" } } }, { "term": { "station_id": {my_station_id} } }, { "nested": { "path": {path}, "query": { "bool": { "must": [ { "exists": { "field": {field} } } ] } } } } ] } }, "size": 0, "aggs": { "station": { "date_histogram": { "field": "@timestamp", "fixed_interval": "1h", "min_doc_count": 1 }, "aggs": { "nested": { "nested": { "path": {path} }, "aggs": { "value": { "avg": { "field": {field} } } } } } } } }
What's strange is that I use the same query with different aggregations (aggs) max, min, and avg values work fine. But when I try to use the date_histogram aggregation, this error occurs.
I'd be happy to provide further details where needed or a full request example. Thanks in advance.