I tried field collapsing query with following query DSL:
{
"query": {
"match": {
"Title": "elasticsearch"
}
},
"collapse" : {
"field" : "Category",
"inner_hits": {
"_source": ["Title", "Url"]
"name": "top_docs",
"size": 10
}
}
}
But got following error message:
"reason": "[collapse] failed to parse field [inner_hits]",
"line": 10,
"col": 24,
"caused_by": {
"type": "illegal_argument_exception",
"reason": "[inner_hits] _source doesn't support values of type: START_ARRAY"
}
Per https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-request-inner-hits.html, source filtering is supported in inner_hits options.
Anything wrong in my DSL?