Join GitHub today
Within a sub-aggregation of a reverse_nested aggregation, cannot filter on nested fields #6994
I'm unsure if this is a bug or something that wasn't intended to work. In the example below, I'm trying to find the 'foo' object that has the nested 'bar' object named 'bar0'. I then want to know how many nested 'baz' objects the 'foo' contains. After using reverse_nested I can use the first-level fields of 'foo0', but not the nested fields.
Using my actual data this sometimes did work, which is why I thought there might be a bug here. So for example two root objects would contain a certain nested object ('bar'), but only one was returning a proper count of another nested object (baz). With my example I wasn't able to recreate this.