Keyword marker will not protect from synonym filter


(ed) #1

Hi, I'm using a synonym filter in my analyzer. Here is an example:

"my_synonym": {
"filter": [
"lowercase",
"asciifolding",
"protwords",
"filter_stop",
"snowball",
"synonym"
],
"char_filter": [
"my_char_filter"
],
"tokenizer": "whitespace"
}

In my synonym file, I have "kfc=>kentucky friend chicken". So naturally, when I have text input of 'kfc', elasticsearch will output 'kentucky fried chicken.' However, when I add my protword filter, I can't seem to mark 'kfc' as a protected keyword. Here is my protword filter:

"protwords": {
"type" : "keyword_marker",
"keywords" : ["kfc"]
}

Does the synonym filter not honor the keyword marker? or Am I doing this wrong? Thanks for your help!


(ed) #2

It turns out keyword marker only protects from stemmers. My fault for not reading the documentation thoroughly enough. So there you have it :slight_smile:


(system) #3