# Custom analyzer: keyword\_marker

**URL:** <https://discuss.elastic.co/t/custom-analyzer-keyword-marker/1738>\
**Category:** Elasticsearch\
**Created:** [June 2, 2015, 2:28pm UTC](https://discuss.elastic.co/t/custom-analyzer-keyword-marker/1738 "2015-06-02T14:28:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SaskiaVola](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@SaskiaVola](https://discuss.elastic.co/u/SaskiaVola)\
**Post date:** [June 2, 2015, 2:28pm UTC](https://discuss.elastic.co/t/custom-analyzer-keyword-marker/1738/1 "2015-06-02T14:28:41Z")

</div>

I'm using a custom analyzer that protects some keywords from being stemmed.

The functionality works as expected, the keyword is not being stemmed, BUT for some reason a second analyzed version of the keyword is being produced:

Here's the behaviour when using the \_analyze endpoint:

GET /myIndex/\_analyze?analyzer=germanComp  
{  
"AIDS"  
}

{  
"tokens": [  
{  
"token": "aids",  
"start\_offset": 7,  
"end\_offset": 11,  
"type": "",  
"position": 1  
},  
{  
"token": "aid",  
"start\_offset": 7,  
"end\_offset": 10,  
"type": "",  
"position": 1  
}  
]  
}

The first token is perfect, but I'd like to get rid of the second one.

Any idea how I can achieve it?

Here's my custom analyzer:

"analysis": {  
"filter": {  
"german\_stop": {  
"type": "stop",  
"stopwords": "_german_"  
},  
"itm\_keywords": {  
"type" : "keyword\_marker",  
"keywords" : ["aids"]  
},  
"german\_stemmer": {  
"type": "stemmer",  
"language": "light\_german"  
},  
"unify": {  
"type": "unique",  
"only\_on\_same\_position": true  
}  
},  
"analyzer": {  
"germanComp": {  
"tokenizer": "standard",  
"filter": [  
"lowercase",  
"itm\_keywords",  
"german\_stop",  
"german\_normalization",  
"german\_stemmer",  
"unify"  
]  
}

---

<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 6, 2017, 12:10am UTC](https://discuss.elastic.co/t/custom-analyzer-keyword-marker/1738/2 "2017-07-06T00:10:10Z")

</div>


