Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elasticsearch: get a list of the terms that were matched in each result

How can I get the list of terms that elasticsearch matched in each result? I know the highlight contains this but I want to get a list of the terms that were found without manually performing postprocessing on the highlight for each result.

like image 788
phan7asm Avatar asked Oct 17 '22 19:10

phan7asm


1 Answers

You could use named queries with unique query for each term.

Search result will contain matched queries for each document in result.

like image 94
Nirmal Avatar answered Oct 21 '22 05:10

Nirmal