rest-api-spec.test.search.aggregation.230_composite_unsigned.yml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rest-api-spec Show documentation
Show all versions of rest-api-spec Show documentation
OpenSearch subproject :rest-api-spec
The newest version!
setup:
- skip:
version: " - 2.7.99"
reason: unsigned_long is not supported before 2.8.0
- do:
indices.create:
index: test
body:
mappings:
properties:
date:
type: date
keyword:
type: keyword
unsigned_long:
type: unsigned_long
geo_point:
type: geo_point
nested:
type: nested
properties:
nested_unsigned_long:
type: unsigned_long
- do:
indices.create:
index: other
body:
mappings:
properties:
date:
type: date
unsigned_long:
type: unsigned_long
nested:
type: nested
properties:
nested_long:
type: long
- do:
index:
index: test
id: 1
body: { "keyword": "foo", "unsigned_long": [10223372036854775807, 184], "geo_point": "37.2343,-115.8067", "nested": [{"nested_unsigned_long": 10223372036854775807}, {"nested_unsigned_long": 184}] }
- do:
index:
index: test
id: 2
body: { "keyword": ["foo", "bar"], "geo_point": "41.12,-71.34" }
- do:
index:
index: test
id: 3
body: { "keyword": "bar", "unsigned_long": [100, 0], "geo_point": "90.0,0.0", "nested": [{"nested_unsigned_long": 184}, {"nested_unsigned_long": 0}] }
- do:
index:
index: test
id: 4
body: { "keyword": "bar", "unsigned_long": [1000, 0], "geo_point": "41.12,-71.34", "nested": [{"nested_unsigned_long": 1000}, {"nested_unsigned_long": 10223372036854775807}] }
- do:
index:
index: test
id: 5
body: { "date": "2017-10-20T03:08:45" }
- do:
index:
index: test
id: 6
body: { "date": "2017-10-21T07:00:00" }
- do:
index:
index: other
id: 0
body: { "date": "2017-10-20T03:08:45" }
- do:
indices.refresh:
index: [test, other]
---
"Nested Composite aggregation":
- do:
search:
rest_total_hits_as_int: true
index: test
body:
aggregations:
test:
composite:
sources: [
{
"unsigned_long": {
"terms": {
"field": "unsigned_long"
}
}
},
{
"kw": {
"terms": {
"field": "keyword"
}
}
}
]
- match: { hits.total: 6 }
- length: { aggregations.test.buckets: 5 }
- match: { aggregations.test.buckets.0.key.unsigned_long: 0}
- match: { aggregations.test.buckets.0.key.kw: "bar" }
- match: { aggregations.test.buckets.0.doc_count: 2 }
- match: { aggregations.test.buckets.1.key.unsigned_long: 100 }
- match: { aggregations.test.buckets.1.key.kw: "bar"}
- match: { aggregations.test.buckets.1.doc_count: 1 }
- match: { aggregations.test.buckets.2.key.unsigned_long: 184 }
- match: { aggregations.test.buckets.2.key.kw: "foo" }
- match: { aggregations.test.buckets.2.doc_count: 1 }
- match: { aggregations.test.buckets.3.key.unsigned_long: 1000}
- match: { aggregations.test.buckets.3.key.kw: "bar" }
- match: { aggregations.test.buckets.3.doc_count: 1 }
- match: { aggregations.test.buckets.4.key.unsigned_long: 10223372036854775807 }
- match: { aggregations.test.buckets.4.key.kw: "foo" }
- match: { aggregations.test.buckets.4.doc_count: 1 }
---
"Aggregate After":
- do:
search:
rest_total_hits_as_int: true
index: test
body:
aggregations:
test:
composite:
sources: [
{
"unsigned_long": {
"terms": {
"field": "unsigned_long"
}
}
},
{
"kw": {
"terms": {
"field": "keyword"
}
}
}
]
after: { "unsigned_long": 184, "kw": "foo" }
- match: { hits.total: 6 }
- length: { aggregations.test.buckets: 2 }
- match: { aggregations.test.buckets.0.key.unsigned_long: 1000 }
- match: { aggregations.test.buckets.0.key.kw: "bar" }
- match: { aggregations.test.buckets.0.doc_count: 1 }
- match: { aggregations.test.buckets.1.key.unsigned_long: 10223372036854775807 }
- match: { aggregations.test.buckets.1.key.kw: "foo" }
- match: { aggregations.test.buckets.1.doc_count: 1 }
---
"Composite aggregation with nested parent":
- do:
search:
rest_total_hits_as_int: true
index: test
body:
aggregations:
1:
nested:
path: nested
aggs:
2:
composite:
sources: [
"nested": {
"terms": {
"field": "nested.nested_unsigned_long"
}
}
]
- match: { hits.total: 6 }
- length: { aggregations.1.2.buckets: 4 }
- match: { aggregations.1.2.buckets.0.key.nested: 0 }
- match: { aggregations.1.2.buckets.0.doc_count: 1 }
- match: { aggregations.1.2.buckets.1.key.nested: 184 }
- match: { aggregations.1.2.buckets.1.doc_count: 2 }
- match: { aggregations.1.2.buckets.2.key.nested: 1000 }
- match: { aggregations.1.2.buckets.2.doc_count: 1 }
- match: { aggregations.1.2.buckets.3.key.nested: 10223372036854775807 }
- match: { aggregations.1.2.buckets.3.doc_count: 2 }
- do:
search:
rest_total_hits_as_int: true
index: test
body:
aggregations:
1:
nested:
path: nested
aggs:
2:
composite:
after: { "nested": 184 }
sources: [
"nested": {
"terms": {
"field": "nested.nested_unsigned_long"
}
}
]
- match: {hits.total: 6}
- length: { aggregations.1.2.buckets: 2 }
- match: { aggregations.1.2.buckets.0.key.nested: 1000 }
- match: { aggregations.1.2.buckets.0.doc_count: 1 }
- match: { aggregations.1.2.buckets.1.key.nested: 10223372036854775807 }
- match: { aggregations.1.2.buckets.1.doc_count: 2 }
---
"Composite aggregation with unmapped field":
- do:
search:
rest_total_hits_as_int: true
index: [test, other]
body:
aggregations:
test:
composite:
sources: [
{
"unsigned_long": {
"terms": {
"field": "unsigned_long"
}
}
},
{
"kw": {
"terms": {
"field": "keyword"
}
}
}
]
- match: {hits.total: 7}
- length: { aggregations.test.buckets: 5 }
- match: { aggregations.test.buckets.0.key.unsigned_long: 0}
- match: { aggregations.test.buckets.0.key.kw: "bar" }
- match: { aggregations.test.buckets.0.doc_count: 2 }
- match: { aggregations.test.buckets.1.key.unsigned_long: 100 }
- match: { aggregations.test.buckets.1.key.kw: "bar"}
- match: { aggregations.test.buckets.1.doc_count: 1 }
- match: { aggregations.test.buckets.2.key.unsigned_long: 184 }
- match: { aggregations.test.buckets.2.key.kw: "foo" }
- match: { aggregations.test.buckets.2.doc_count: 1 }
- match: { aggregations.test.buckets.3.key.unsigned_long: 1000}
- match: { aggregations.test.buckets.3.key.kw: "bar" }
- match: { aggregations.test.buckets.3.doc_count: 1 }
- match: { aggregations.test.buckets.4.key.unsigned_long: 10223372036854775807 }
- match: { aggregations.test.buckets.4.key.kw: "foo" }
- match: { aggregations.test.buckets.4.doc_count: 1 }
- do:
search:
rest_total_hits_as_int: true
index: [test, other]
body:
aggregations:
test:
composite:
after: { "unsigned_long": 1000, "kw": "bar" }
sources: [
{
"unsigned_long": {
"terms": {
"field": "unsigned_long"
}
}
},
{
"kw": {
"terms": {
"field": "keyword"
}
}
}
]
- match: {hits.total: 7}
- length: { aggregations.test.buckets: 1 }
- match: { aggregations.test.buckets.0.key.unsigned_long: 10223372036854775807 }
- match: { aggregations.test.buckets.0.key.kw: "foo" }
- match: { aggregations.test.buckets.0.doc_count: 1 }
---
"Terms source from sorted":
- do:
indices.create:
index: sorted_test
body:
settings:
sort.field: keyword
mappings:
properties:
keyword:
type: keyword
unsigned_long:
type: unsigned_long
- do:
index:
index: sorted_test
id: 2
refresh: true
body: { "keyword": "foo", "unsigned_long": 1 }
- do:
search:
index: sorted_test
rest_total_hits_as_int: true
body:
aggregations:
test:
composite:
sources:
- keyword:
terms:
field: keyword
- match: { hits.total: 1 }
- length: { aggregations.test.buckets: 1 }
- match: { aggregations.test.buckets.0.key.keyword: "foo" }
- match: { aggregations.test.buckets.0.doc_count: 1 }
© 2015 - 2024 Weber Informatics LLC | Privacy Policy