forked from opensearch-project/OpenSearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Finn Carroll <[email protected]>
- Loading branch information
1 parent
6ef3703
commit 9fc7c2e
Showing
2 changed files
with
113 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
...-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/420_range_sub_aggs.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
--- | ||
setup: | ||
- do: | ||
indices.create: | ||
index: test_range_sub_aggs | ||
body: | ||
settings: | ||
number_of_shards: 1 | ||
number_of_replicas: 0 | ||
mappings: | ||
properties: | ||
date: | ||
type: date | ||
- do: | ||
bulk: | ||
refresh: true | ||
index: test | ||
body: | ||
- '{"index": {}}' | ||
- '{"date": "2020-03-01", "v": 1}' | ||
- '{"index": {}}' | ||
- '{"date": "2020-03-01", "v": 11}' | ||
- '{"index": {}}' | ||
- '{"date": "2020-03-02", "v": 12}' | ||
- '{"index": {}}' | ||
- '{"date": "2020-03-02", "v": 22}' | ||
- '{"index": {}}' | ||
- '{"date": "2020-03-08", "v": 13}' | ||
- '{"index": {}}' | ||
- '{"date": "2020-03-08", "v": 28}' | ||
- '{"index": {}}' | ||
- '{"date": "2020-03-08", "v": 28}' | ||
- '{"index": {}}' | ||
- '{"date": "2020-03-08", "v": 39}' | ||
- '{"index": {}}' | ||
- '{"date": "2020-03-09", "v": 4}' | ||
|
||
--- | ||
"date_histogram with range sub aggregation": | ||
- do: | ||
search: | ||
body: | ||
size: 0 | ||
aggs: | ||
my_range: | ||
range: | ||
field: v | ||
ranges: | ||
- to: 10 | ||
- from: 10 | ||
to: 20 | ||
- from: 20 | ||
to: 30 | ||
- from: 30 | ||
to: 40 | ||
aggs: | ||
histo: | ||
date_histogram: | ||
field: date | ||
calendar_interval: day | ||
|
||
# - match: { hits.total.value: 9 } | ||
# - length: { aggregations.histo.buckets: 9 } | ||
# | ||
# - match: { aggregations.histo.buckets.0.key_as_string: "2020-03-01T00:00:00.000Z" } | ||
# - match: { aggregations.histo.buckets.1.key_as_string: "2020-03-02T00:00:00.000Z" } | ||
# - match: { aggregations.histo.buckets.7.key_as_string: "2020-03-08T00:00:00.000Z" } | ||
# - match: { aggregations.histo.buckets.8.key_as_string: "2020-03-09T00:00:00.000Z" } | ||
# | ||
# - match: { aggregations.histo.buckets.0.doc_count: 2 } | ||
# - match: { aggregations.histo.buckets.1.doc_count: 2 } | ||
# - match: { aggregations.histo.buckets.2.doc_count: 0 } | ||
# - match: { aggregations.histo.buckets.7.doc_count: 4 } | ||
# - match: { aggregations.histo.buckets.8.doc_count: 1 } | ||
# | ||
# - match: { aggregations.histo.buckets.0.my_range.buckets.0.doc_count: 1 } | ||
# - match: { aggregations.histo.buckets.7.my_range.buckets.2.doc_count: 2 } | ||
# - match: { aggregations.histo.buckets.7.my_range.buckets.1.doc_count: 1 } |