2

I want to exclude the default stop words from being highlighted but I'm not sure why this isn't working

ES config

"settings": {
    "analysis": {
        "analyzer": {
            "search_synonyms": {
                "tokenizer": "whitespace",
                "filter": [
                    "graph_synonyms",
                    "lowercase",
                    "asciifolding",
                    "stop"
                ],
            }
        },
        "filter": {
            "graph_synonyms": {
                ...
            }
        },
        "normalizer": {
            "normalizer_1": {
                ...
            }
        }
    }
},

Fields mapping:

"mappings": {
    "properties": {
        "description": {
            "type": "text",
            "analyzer": "search_synonyms"
        },
        "narrative": {
            "type":"object",
            "properties":{
                "_all":{
                    "type": "text",
                    "analyzer": "search_synonyms"
                }
            }
        },
        "originator": {
            "type": "keyword",
            "normalizer": "normalizer_1"
        },
        ................
    }
}

Highlight query:

highlight : {
    fields:{
        "*":{}
    }
},

Currently I'm getting stop words such as this, A, IS highlighted within narrative fields and I want to prevent that.

shAkur
  • 944
  • 2
  • 21
  • 45
  • you have got any solution for this ? – Satyaaditya Sep 07 '20 at 17:19
  • My problem was that stop words were being highlighted for 'narrative' fields. I posted this a long time ago so I'm not sure if this still persists or not but you can try something like: https://pastebin.com/qKWDGNau – shAkur Sep 08 '20 at 06:58

0 Answers0