Skip to content

Commit 66baa3a

Browse files
committed
Add YAML test for correct handling of invalid reverse-nested aggs
1 parent 7a4aebb commit 66baa3a

File tree

1 file changed

+23
-0
lines changed
  • modules/aggregations/src/yamlRestTest/resources/rest-api-spec/test/aggregations

1 file changed

+23
-0
lines changed

modules/aggregations/src/yamlRestTest/resources/rest-api-spec/test/aggregations/nested.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,3 +194,26 @@ setup:
194194
- match: { aggregations.courses.highpass_filter.unnest.department.buckets.0.doc_count: 1 }
195195
- match: { aggregations.courses.highpass_filter.unnest.department.buckets.1.key: math }
196196
- match: { aggregations.courses.highpass_filter.unnest.department.buckets.1.doc_count: 1 }
197+
---
198+
"Illegal reverse nested aggregation to a child nested object":
199+
- do:
200+
catch: /Reverse nested path \[courses.sessions\] is not a parent of the current nested scope \[courses\]/
201+
search:
202+
index: test
203+
body:
204+
{
205+
"aggs": {
206+
"parent_nested": {
207+
"nested": {
208+
"path": "courses"
209+
},
210+
"aggs": {
211+
"invalid_reverse_nested": {
212+
"reverse_nested": {
213+
"path": "courses.sessions"
214+
}
215+
}
216+
}
217+
}
218+
}
219+
}

0 commit comments

Comments
 (0)