phan7asm
phan7asm

Reputation: 63

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.

Upvotes: 6

Views: 1488

Answers (1)

Nirmal
Nirmal

Reputation: 1336

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

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

Upvotes: 3

Related Questions