Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

Buckets Inside Buckets example needs .keyword #694

Open
mikepedroza opened this issue Jun 14, 2017 · 1 comment
Open

Buckets Inside Buckets example needs .keyword #694

mikepedroza opened this issue Jun 14, 2017 · 1 comment

Comments

@mikepedroza
Copy link

https://www.elastic.co/guide/en/elasticsearch/guide/master/_buckets_inside_buckets.html#_buckets_inside_buckets
The following example won't work unless you specify the .keyword on color/price/make.

GET /cars/transactions/_search
{
"size" : 0,
"aggs": {
"colors": {
"terms": {
"field": "color"
},
"aggs": {
"avg_price": {
"avg": {
"field": "price"
}
},
"make": {
"terms": {
"field": "make"
}
}
}
}
}
}

@mikepedroza
Copy link
Author

Also.. it would be good to explain on the first example using .keyword 1) why it's needed & 2) how the auto-index generation automatically adds it to the text fields.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant