Configure Elasticsearch to not highlight stopwords
You are looking for highlight_query:
- Use _analyze to analysis The Lord of the Rings to get words without stopwords
- Use
highlight_query
to search with The Lord of the Rings and no stop words from 1.
maybe like:
GET /_search{ "query" : { "match": { "my_field": { "query": "The Lord of the Rings" } } }, "highlight" : { "order" : "score", "fields" : { "my_field" : { "highlight_query": { "bool": { "should": { "match_phrase": { "content": { "query": "my words" } } } } } } } }}