In elasticsearch, is there a way to show which field in the document was a β€œhit”?

When searching for some documents using elasticsearch, I would like to see which field in the document was a β€œhit”, which is marked as a search result. Is there my own way to do this, or do I need to do this in the search client?

eg:

GET /events/_search?q=nottingham

gives me:

{//elided
    {'hits'[
       {'id':1,
        'name': 'Some name',
        'nicknames': ['Nottingham']
       }]}}

In this example, it is obvious that the alias is mapped, but can I get elasticsearch to mark this for me?

+3
source share
1 answer

All Articles