# Error loading file for custom synonym file in Elasticsearch

**URL:** <https://discuss.elastic.co/t/error-loading-file-for-custom-synonym-file-in-elasticsearch/10698>\
**Category:** Elasticsearch\
**Created:** [February 11, 2013, 7:10pm UTC](https://discuss.elastic.co/t/error-loading-file-for-custom-synonym-file-in-elasticsearch/10698 "2013-02-11T19:10:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bruno\_Miranda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bruno_miranda/32/746_2.png) [@Bruno\_Miranda](https://discuss.elastic.co/u/Bruno_Miranda)\
**Post date:** [February 11, 2013, 7:10pm UTC](https://discuss.elastic.co/t/error-loading-file-for-custom-synonym-file-in-elasticsearch/10698/1 "2013-02-11T19:10:24Z")

</div>

I am using Rails, Tire and Elasticsearch on EC2. With a custom initializer  
as such:

```
analysis:
  filter:        
    name_synonyms:
      type: synonym
      synonyms_path: <%= Rails.root.join("config", "synonyms", 

```

"name\_synonyms.txt") %\>

This file run thru Erubis and the synonyms path is converted to something  
like this:

/root/workspace/project-project-0f317744a1870b4baf61bbaeb390ebe1/config/  
synonyms/term\_synonyms.txt

When I list the files in the sever I see the following:

root@ip-XX-XXX-XX-XXX:~/workspace/project-project-  
0f317744a1870b4baf61bbaeb390ebe1/config/synonyms# ls -la  
total 20  
drwxr-xr-x 2 root root 4096 Feb 11 18:25 .  
drwxr-xr-x 7 root root 4096 Feb 11 18:25 ..  
-rw-r--r-- 1 root root 3117 Feb 11 18:25 location\_synonyms.txt  
-rw-r--r-- 1 root root 3999 Feb 11 18:25 name\_synonyms.txt  
-rw-r--r-- 1 root root 2144 Feb 11 18:25 term\_synonyms.txt

Which is exactly I am expecting, however I see the following error when  
running `rake spec`

[ERROR] There has been an error when creating the index -- elasticsearch  
returned:  
500 : {"error":"IndexCreationException[[test\_colleagues] failed to create  
index]; nested: FailedToResolveConfigException[Failed to resolve config  
path  
[/root/workspace/project-project-0f317744a1870b4baf61bbaeb390ebe1/config/synonyms/term\_synonyms.txt],  
tried file path  
[/root/workspace/project-project-0f317744a1870b4baf61bbaeb390ebe1/config/synonyms/term\_synonyms.txt],  
path file  
[/etc/elasticsearch/root/workspace/project-project-0f317744a1870b4baf61bbaeb390ebe1/config/synonyms/term\_synonyms.txt],  
and classpath]; ","status":500}

It seems to me Elasticsearch is not capable of loading the files although  
the path is correct, could be a load order issue, I am really not too sure.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:52am UTC](https://discuss.elastic.co/t/error-loading-file-for-custom-synonym-file-in-elasticsearch/10698/2 "2017-07-06T02:52:03Z")

</div>

Closed on July 6, 2017, 2:52am UTC


