Configure Elasticsearch to not highlight stopwords Configure Elasticsearch to not highlight stopwords elasticsearch elasticsearch

Configure Elasticsearch to not highlight stopwords


You are looking for highlight_query:

  1. Use _analyze to analysis The Lord of the Rings to get words without stopwords
  2. Use highlight_queryto 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"                                }                            }                        }                    }                }            }        }    }}