I want to use synonyms feature of elastic search . I don't know where to keep it. Need help!
Asked
Active
Viewed 2,766 times
4
-
How do you have installed Elasticsearch using zip or through repository(in case of Linux) ? Generally in CentOS config file location is `/etc/elasticsearch/elasticsearch.yml` – Roopendra May 30 '17 at 09:49
1 Answers
3
You can place synonyms file in path relative to the config location.
You can have a look at Directory layout of your ES setup.
It contains a config
folder where you can place your synonym
file and then specify relative path of that file.
For Example
"filter" : {
"synonym" : {
"type" : "synonym",
"synonyms_path" : "analysis/synonym.txt"
}
}
The above configures a synonym filter, with a path of analysis/synonym.txt (relative to the config location).
See this for more detail
EDIT:
You can also specify absolute path. As per doc
The path to the synonyms file should be specified with the synonyms_path parameter, and should be either absolute or relative to the Elasticsearch config directory.
Refer this

Richa
- 7,419
- 6
- 25
- 34
-
1For production code , why should the file be kept, there must be some other location where that file can be kept coz i dont see it as a nice practice,do u have know alternative to this – Shweta Gulati May 30 '17 at 18:31
-