Can anyone help me simplify the complex nested aggregation in an Elasticsearch? Or is it final result
I am trying to understand how to dynamically build the aggregations with nested and regular filters for regular or nested fields, so, my final query looks like code below and would be fine if it can be simplified to two levels (first – level of filters, second – level of a terms query)