-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Description
How can I create a nested aggregation with filters?
I have the following aggregation json, and I'm trying to express with the new driver. Actually I have code that works perfectly with NEST7, but I want to transition everything to the new driver since NEST is deprecated.
My problem is that, in the new driver I found a FiltersAggregation object that has the property filters not filter (single filter), so it does not generate the query below.
Can you point me on the right direction? The new driver really lacks extensive documentation and if you search you got most of the information on the old driver and nothing on the new one.
"aggs": {
"JarvisField_1/JarvisField_3": {
"nested": {
"path": "nested"
},
"aggs": {
"path_filter": {
"filter": {
"term": {
"nested.path.na": "JarvisField_1/JarvisField_3"
}
},
"aggs": {
"JarvisField_1/JarvisField_3": {
"terms": {
"field": "nested.svalue",
"size": 1
},
"aggs": {
"reverse_nested": {
"reverse_nested": {}
}
}
}
}
}
}
},
"@@nesteduncategorized": {
"filter": {
"bool": {
"must_not": [
{
"nested": {
"path": "nested",
"query": {
"term": {
"nested.path.na": "JarvisField_1/JarvisField_3"
}
}
}
}
]
}
},
"aggs": {
"@@uncategorized": {
"filter": {
"match_all": {}
}
}
}
}
},