I am using Rails, Tire and Elasticsearch on EC2 single server setup, no sharding or replication (this is the Jenkins CI Server). With a custom initializer as such:
analysis:
filter:
name_synonyms:
type: synonym
synonyms_path: <%= Rails.root.join("config", "synonyms", "name_synonyms.txt") %>
This file runs 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
500 : {"error":"IndexCreationException[[test_facilities] 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.