elasticsearch/elasticsearch — pull request #8770 by martijnvg (2014-12-03 17:25:12+00:00)
Title: inner_hits: Added another more compact syntax for inner hits.

Adds a more compact syntax that is sufficient most of the times:

```json
{
"query" : {
"nested" : {
"path" : "comments",
"query" : {
"match" : {"comments.message" : "[actual query]"}
},
"_inner_hits" : {
"comment" : {} <--- Multiple inner hits can be defined each with different options (sorting, highlighting etc.)
}
}
}
}
```

which would otherwise look like:
```json
{
"query" : {
"nested" : {
"path" : "comments",
"query" : {
"match" : {"comments.message" : "[actual query]"}
}
}
},
"inner_hits" : {
"comment" : {
"path" : {
"comments" : {
"query" : {
"match" : {"comments.message" : "[actual query]"}
}
}
}
}
}
}
```