77            number_of_shards : 2  # Two shards proves that we route properly
88          mappings :
99            properties :
10-               join_field : { "type": "join", "relations": { "parent": "child", "child": "grand_child" } } 
11-               id : { "type": "keyword" } 
10+               join_field :
11+                 type : join 
12+                 relations :
13+                   parent : child 
14+                   child : grand_child 
15+               id :
16+                 type : keyword 
1217
1318  - do :
1419      bulk :
2934          - ' { "join_field": { "name": "grand_child", "parent": "5" } }' 
3035
3136---
32- unconfigured :
37+ unconfigured children  :
3338  - do :
3439      index :
3540        index : test_unconfigured 
@@ -53,6 +58,31 @@ unconfigured:
5358  - match : { hits.total.value: 1 } 
5459  - match : { aggregations.to-answers.doc_count: 0 } 
5560
61+ ---
62+ unconfigured parent :
63+   - do :
64+       index :
65+         index : test_unconfigured 
66+         refresh : true 
67+         body :
68+           join :
69+             name : question 
70+           body : <p>I have Windows 2003 server and i bought a new Windows 2008 server..., 
71+           title : Whats the best way to file transfer my site from server to a newer one?, 
72+           tags : [windows-server-2003, windows-server-2008, file-transfer] 
73+ 
74+   - do :
75+       search :
76+         index : test_unconfigured 
77+         body :
78+           size : 0 
79+           aggs :
80+             to-answers :
81+               parent :
82+                 type : answer 
83+   - match : { hits.total.value: 1 } 
84+   - match : { aggregations.to-answers.doc_count: 0 } 
85+ 
5686---
5787children :
5888  - do :
@@ -173,3 +203,50 @@ parent terms terms:
173203  - match : { aggregations.parent.tag.buckets.0.subject.buckets.0.key: surprises } 
174204  - match : { aggregations.parent.tag.buckets.1.key: jumble } 
175205  - match : { aggregations.parent.tag.buckets.1.subject.buckets.0.key: critters } 
206+ 
207+ ---
208+ term children :
209+   - do :
210+       search :
211+         index : test 
212+         body :
213+           size : 0 
214+           aggs :
215+             subject :
216+               terms :
217+                 field : subject.keyword 
218+               aggs :
219+                 children :
220+                   children :
221+                     type : child 
222+   - match : { hits.total.value: 6 } 
223+   - match : { aggregations.subject.buckets.0.key: critters } 
224+   - match : { aggregations.subject.buckets.0.doc_count: 1 } 
225+   - match : { aggregations.subject.buckets.0.children.doc_count: 1 } 
226+   - match : { aggregations.subject.buckets.1.key: surprises } 
227+   - match : { aggregations.subject.buckets.1.doc_count: 1 } 
228+   - match : { aggregations.subject.buckets.1.children.doc_count: 2 } 
229+ 
230+ ---
231+ term parent :
232+   - do :
233+       search :
234+         index : test 
235+         body :
236+           size : 0 
237+           aggs :
238+             animal :
239+               terms :
240+                 field : animal.keyword 
241+               aggs :
242+                 parent :
243+                   parent :
244+                     type : child 
245+   - match : { hits.total.value: 6 } 
246+   - match : { aggregations.animal.buckets.0.key: dog } 
247+   - match : { aggregations.animal.buckets.0.doc_count: 2 } 
248+   - match : { aggregations.animal.buckets.0.parent.doc_count: 2 } 
249+   - match : { aggregations.animal.buckets.1.key: cat } 
250+   - match : { aggregations.animal.buckets.1.doc_count: 1 } 
251+   - match : { aggregations.animal.buckets.1.parent.doc_count: 1 } 
252+ 
0 commit comments