According to the documentation for top hits aggregations (ES 2.1), there is support for highlighting of the hits returned. Is there an example of how to implement this?
I've tried the following (bucket agg combined with top hits agg) and it doesn't seem to return any highlighted fields:
{'aggs': {
'dup_groups': {
'aggs': {
'first_doc': {
'top_hits': {
'highlight': {'fields': {'text.stemmed': {}}},
'size': 1,
'sort': 'date'}}},
'terms': {'field': 'dup_parent', 'size': 0}}},
'query': {'query_string': {'query': 'world'}}}
I should note that my field text.stemmed
works perfectly fine for highlighting in a regular search query without aggregations.