Skip to content

Commit

Permalink
Add test about nested aggregation
Browse files Browse the repository at this point in the history
Signed-off-by: kkewwei <[email protected]>
Signed-off-by: kewei.11 <[email protected]>
  • Loading branch information
kkewwei committed Sep 21, 2024
1 parent c2c666f commit bc05ea0
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions tests/default/_core/search/aggs/nested_agg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
$schema: ../../../../../json_schemas/test_story.schema.yaml

description: Test aggregation.
prologues:
- path: books
method: PUT
request:
payload:
mappings:
properties:
details:
type: nested
properties:
title:
type: keyword
- path: /_bulk
method: POST
parameters:
refresh: true
request:
content_type: application/x-ndjson
payload:
- {index: {_index: books, _id: '0'}}
- {details: {title: title1}}
- {index: {_index: books, _id: '1'}}
- {details: {title: title2}}
chapters:
- synopsis: Aggregation with nested.
path: /{index}/_search
parameters:
index: books
method: POST
request:
payload:
size: 0
aggregations:
title:
nested:
path: details
response:
status: 200
payload:
timed_out: false
_shards:
total: 1
successful: 1
skipped: 0
failed: 0
hits:
total:
value: 2
relation: eq
max_score: null
hits: []
aggregations:
title:
doc_count: 2
epilogues:
- path: /books
method: DELETE
status: [200, 404]

0 comments on commit bc05ea0

Please sign in to comment.