# Keyword marker will not protect from synonym filter

**URL:** <https://discuss.elastic.co/t/keyword-marker-will-not-protect-from-synonym-filter/64784>\
**Category:** Elasticsearch\
**Created:** [November 2, 2016, 11:52pm UTC](https://discuss.elastic.co/t/keyword-marker-will-not-protect-from-synonym-filter/64784 "2016-11-02T23:52:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![coffeeholic](https://avatars.discourse-cdn.com/v4/letter/c/e9a140/32.png) [@coffeeholic](https://discuss.elastic.co/u/coffeeholic)\
**Post date:** [November 2, 2016, 11:52pm UTC](https://discuss.elastic.co/t/keyword-marker-will-not-protect-from-synonym-filter/64784/1 "2016-11-02T23:52:59Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![coffeeholic](https://avatars.discourse-cdn.com/v4/letter/c/e9a140/32.png) [@coffeeholic](https://discuss.elastic.co/u/coffeeholic)\
**Post date:** [November 3, 2016, 4:32pm UTC](https://discuss.elastic.co/t/keyword-marker-will-not-protect-from-synonym-filter/64784/2 "2016-11-03T16:32:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 10:06pm UTC](https://discuss.elastic.co/t/keyword-marker-will-not-protect-from-synonym-filter/64784/3 "2017-07-05T22:06:52Z")

</div>


