(IOException while reading synonyms_path_path) synonym token filter configuration

I am using synonyms token filter with custom file

installed elasticsearch 6.7 as a service on windows 10 machine
my "synonyms.txt" is located at "C:\ProgramData\Elastic\Elasticsearch\config\analysis\synonyms.txt"

here is my index settings

PUT /synonyms
{
"settings": {
"analysis": {
"filter": {
"synonym": {
"type": "synonym",
"synonyms_path": "analysis/synonyms.txt"
}
},
"analyzer": {
"my_analyzer": {
"tokenizer": "standard",
"filter": [
"lowercase",
"synonym"
]
}}
}
},
"mappings": {
"_doc": {
"properties": {
"description": {
"type": "text",
"analyzer": "my_analyzer"
}
}
}
}
}

i am getting this error while creating above index
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "IOException while reading synonyms_path_path: C:\ProgramData\Elastic\Elasticsearch\config\analysis\synonyms.txt"
}
],
"type": "illegal_argument_exception",
"reason": "IOException while reading synonyms_path_path: C:\ProgramData\Elastic\Elasticsearch\config\analysis\synonyms.txt",
"caused_by": {
"type": "no_such_file_exception",
"reason": "C:\ProgramData\Elastic\Elasticsearch\config\analysis\synonyms.txt"
}
},
"status": 400
}

also tried synonyms token filter in elasticsearch installed as archive distribution (.zip) on windows machine but getting same error
but in linux machine for both archive as well as package distributions it is working.

Thanks in advance.happy searching

the problem here is the file extensions are hidden from control panel.so you can just go to control panel>file explorer options> click on view tab there uncheck option(hide extension for known file types) it should look something like this now rename your file accordingly and try again

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