# Synonym doesn't work

**URL:** <https://discuss.elastic.co/t/synonym-doesnt-work/12974>\
**Category:** Elasticsearch\
**Created:** [July 28, 2013, 1:31pm UTC](https://discuss.elastic.co/t/synonym-doesnt-work/12974 "2013-07-28T13:31:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ciprian](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@ciprian](https://discuss.elastic.co/u/ciprian)\
**Post date:** [July 28, 2013, 1:31pm UTC](https://discuss.elastic.co/t/synonym-doesnt-work/12974/1 "2013-07-28T13:31:46Z")

</div>

Hi all,

I've got a problem regarding querying synonyms in Elasticsearch.

Content from synonym.txt file ( is presented below in CONFIGURATION):  
vehicle =\> car

[HOW TO REPRODUCE]  
Enter word **vehicle** for search

[EXPECTED Result]  
Response with files that contains words **vehicle** and **car**

[ACTUAL Result]  
Response with files that contains **ONLY vehicle** word

Configuration :

----\> ﻿curl -X DELETE 'localhost:9200/docs/'  
----\> curl -X PUT 'localhost:9200/docs/' -d '  
{  
"settings" : {  
"index" : {  
"number\_of\_shards" : 1,  
"number\_of\_replicas" : 0,  
"analysis" : {  
"analyzer" : {  
"ta" : {  
"type" : "custom",  
"tokenizer" : "standard",  
"filter" : ["standard", "word\_delimiter", "lowercase", "synonym", "stop", "kstem"]  
}  
},  
"filter" : {  
"synonym" : {  
"type" : "synonym",  
"synonyms\_path" : "analysis/synonym.txt"  
}  
}  
}  
}  
}  
}'

analysis/ **synonym.txt** is in **config** folder from elasticsearch.

content from synonym.txt file :  
vehicle =\> car

-----\> curl -XPUT '[http://localhost:9200/docs/doc/\_mapping](http://localhost:9200/docs/doc/_mapping)' -d '  
{  
"doc" : {  
"properties" : {"file" : {"type" : "attachment","path" : "full","fields" : {"file" : {"type" : "string","store" : "yes","term\_vector" : "with\_positions\_offsets","index" : "analyzed","analyzer" : "french"},"author" : {"type" : "string"},"title" : {"type" : "string","store" : "yes"}, "name" : {"type" : "string"},"date" : {"type" : "date","format" : "dateOptionalTime"},"keywords" : {"type" : "string"},"content\_type" : {"type" : "string" }}}, "name" : {"type" : "string","analyzer" : "keyword"},"pathEncoded" : {"type" : "string","analyzer" : "keyword"}, "postDate" : {"type" : "date","format" : "dateOptionalTime"},"rootpath" : {"type" : "string","analyzer" : "keyword"},"virtualpath" : { "type" : "string","analyzer" : "keyword"}}}}'

-----\> curl -XPUT 'localhost:9200/\_river/docsRiver/\_meta' -d '{  
"type": "fs",  
"fs": {  
"name": "docsRiver",  
"url": "D:\files",  
"update\_rate": 180000,  
"includes": ["_.doc" , "_.xls", "_.pdf", "_.txt"]  
},  
"index": {  
"index": "docs",  
"type": "doc",  
}  
}'

Has anyone any clue?

---

<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, 2:24am UTC](https://discuss.elastic.co/t/synonym-doesnt-work/12974/2 "2017-07-06T02:24:08Z")

</div>


