After upgrading ES from 1.4 to 1.5 some issue appears with terms aggregation.
On ES 1.4 this code is working perfect, beginning from 1.5 it returns empty buckets. Answers are pasted on Gist.
On real mappings there is more fields and more complex query.
I made simple example with problem.
I found one solution, delete mapping (nestedDocs) without documents from example. On production I can't do that because there is documents on both types.
Can any one explain me that is bug on new versions or problem with my mappings or query?