Yield/add search term to ElasticSearch results
问题 I'm doing a ElasticSearch query with multiple terms constructed dynamically, so it looks like this: ... must: [ { terms: { tags_slug: ['term_a', 'term_b'] } }, ... ] ... everything works fine, but I'd like to add to each result, the term that it had match with, so, if for instance the result #1 matched term_a , I'd like somehow to be able to get that term from the current result, something like this: Model.search(...).results[0].matched_term # => 'term_a' Model.search(...).results[1].matched