# How to implement synonyms

**URL:** <https://discuss.elastic.co/t/how-to-implement-synonyms/19691>\
**Category:** Elasticsearch\
**Created:** [September 9, 2014, 5:01pm UTC](https://discuss.elastic.co/t/how-to-implement-synonyms/19691 "2014-09-09T17:01:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![amadman114](https://avatars.discourse-cdn.com/v4/letter/a/b77776/32.png) [@amadman114](https://discuss.elastic.co/u/amadman114)\
**Post date:** [September 9, 2014, 5:01pm UTC](https://discuss.elastic.co/t/how-to-implement-synonyms/19691/1 "2014-09-09T17:01:29Z")

</div>

Hi, I'm trying to implement a synonym filter with my edge\_ngram filter.  
This is my code to create the database:

# Create `icecat` with a single primary shard

# and set up the `autocomplete` analyzer using

# edge ngrams

PUT /icecat  
{  
"settings": {  
"number\_of\_shards": 1,  
"analysis": {  
"filter": {  
"autocomplete\_filter": {  
"type": "edge\_ngram",  
"min\_gram": 1,  
"max\_gram": 15  
},  
"synonym\_filter" : {  
"type" : "synonym",  
"synonyms" :  
["hard drive, hard disk drive, SSD =\> HDD",  
"VDU, screen, LCD, TFT, CRT =\> Monitor",  
"power supply, power adapter, ac adapter, power cord, charger =\> adapter",  
"mice =\> mouse",  
"wire less =\> wireless",  
"pick up =\> pickup",  
"PSU =\> power supply unit",  
"converter =\> adapter",  
"ATX, mobo =\> motherboard",  
"notebook, chromebook, netbook, lap top =\> laptop",  
"CPU, chip, core =\> processor",  
"DDR3, DDR2, DDR =\> memory",  
"gfx, video =\> graphics",  
"laser, engine =\> fuser",  
"mousepad, mouse pad =\> touchpad",  
"small form factor =\> SFF",  
"ginger =\> foxes"]  
}  
},  
"analyzer": {  
"autocomplete": {  
"type": "custom",  
"tokenizer": "standard",  
"filter": [  
"lowercase",  
"autocomplete\_filter",  
"synonym\_filter"  
]  
}  
}  
}  
}  
}

However, after indexing some documents on which the synonyms should work, it doesn't, but it does use the autocomplete filter

---

<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, 1:03am UTC](https://discuss.elastic.co/t/how-to-implement-synonyms/19691/2 "2017-07-06T01:03:35Z")

</div>


