# Add Synonym Analyzer for Keyword field

**URL:** <https://discuss.elastic.co/t/add-synonym-analyzer-for-keyword-field/253469>\
**Category:** Elasticsearch\
**Created:** [October 27, 2020, 4:23pm UTC](https://discuss.elastic.co/t/add-synonym-analyzer-for-keyword-field/253469 "2020-10-27T16:23:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Coder\_Cub](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/coder_cub/32/45327_2.png) [@Coder\_Cub](https://discuss.elastic.co/u/Coder_Cub)\
**Post date:** [October 27, 2020, 4:23pm UTC](https://discuss.elastic.co/t/add-synonym-analyzer-for-keyword-field/253469/1 "2020-10-27T16:23:12Z")

</div>

Hi everyone,

I am stuck here for adding Synonym Analyzer to Keyword field while creating my index.  
Can you please help how can I achieve this or what am I missing?

**Use case:**  
A person can have multiple nick names. If search is made on nick name it should match the record with personname field.

**My custom analyzer:**

"synonym\_keyword\_analyzer":{  
"tokenizer": "keyword",  
"filter":["synonym",  
"lowercase"]  
}

**Field Mapping:**

"personname" : {  
"type" : "keyword",  
"analyzer":"synonym\_keyword\_analyzer"  
}

**Error:**  
Mapping definition for [personname] has unsupported parameters: [analyzer : synonym\_keyword\_analyzer]

Any help is appreciated

Thanks

---

<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:** [November 24, 2020, 4:23pm UTC](https://discuss.elastic.co/t/add-synonym-analyzer-for-keyword-field/253469/2 "2020-11-24T16:23:15Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
