Multilevel aggregation of terms when using nested objects

We have a document format where there are a lot of nested objects and wants
to look at e.g. location / language distribution.

When performing a aggregation where we have 2 levels of nested objects we
get data only from the first level but not from the second level, it is
always 0 in count.

If we do a non nested + nested aggregation it works.

{
"from": 0,
"size": 0,
"aggs": {
"Provider": {
"terms": {
"field": "providerId",
"size": 10,
"order": {
"_count": "desc"
}
},
"aggs": {
"Locations": {
"nested": {
"path": "meta"
},
"aggs": {
"filter": {
"filter": {
"term": {
"meta.type": "locations"
}
},
"aggs": {
"Locations": {
"terms": {
"field": "meta.value",
"size": 3,
"order": {
"_count": "desc"
}
}
}
}
}
}
}
}
}
},
"query": {
"query_string": {
"query": "barclays bank"
}
}
}

If we do a nested + non nested aggregation it does not work.

{
"from": 0,
"size": 0,
"aggs": {
"Locations": {
"nested": {
"path": "meta"
},
"aggs": {
"filter": {
"filter": {
"term": {
"meta.type": "locations"
}
},
"aggs": {
"Locations": {
"terms": {
"field": "meta.value",
"size": 10,
"order": {
"_count": "desc"
}
},
"aggs": {
"Provider": {
"terms": {
"field": "providerId",
"size": 3,
"order": {
"_count": "desc"
}
}
}
}
}
}
}
}
}
},
"query": {
"query_string": {
"query": "barclays bank"
}
}
}

Is there something wrong with my query or is this an issue in elasticsearch?

--

Solid Media Group is a global provider of marketing services within social
and digital media. With more than 60 employees and offices or partners in
19 countries the Group is among the leading European providers, trusted by
more than 11 000 corporations. From Buzz to Business is our mission,
helping our customers to easily and successfully engage, market, publish,
monitor and manage activities across the digital and social media world.
Being the European leader within online news-, social-media-, and
web-monitoring services, we already monitor more than 52 000 news sources
in 51 languages and 180 countries. We have more than 1,5 billion downloaded
and indexed news articles on our servers, a number which increases with
more than 1.5 million each day. Through our partners and integrated
solutions more than 20 000 enterprises are finding and receiving market
updates from our monitoring services every day.

Copyright © 2011-2014 | Solid Media Group | NO 967 771 067 MVA

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/91ca631f-36d0-4325-aa8f-5cce3d340006%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.