Skip to content

Instantly share code, notes, and snippets.

@dptesta
dptesta / nested_aggs.sh
Last active August 29, 2015 13:59
ElasticSearch: Filtering aggregations on nested types
curl -XDELETE localhost:9200/nested_aggs
curl -XPUT localhost:9200/nested_aggs
curl -XPUT localhost:9200/nested_aggs/user/_mapping -d '
{
"_id" : {"index": "not_analyzed", "path" : "userId"},
"properties": {
"userId": {"type": "string", "index": "not_analyzed"},
"groups": {
"type": "nested",
"properties": {