3

I used to work with Solr and it would have configuration folder that would contain stopwords, synonyms, etc files. Every time you would make a change, you can use Zookeeper to download conf file and then upload it and distribute it across all servers in the cluster.

New to ElasticSearch, so pardon the question: Is there a way for me to automatically create such files and have Zookeeper or something else to distribute it automatically instead of manual step (or Puppet scripts)

According to this: http://www.elastic.co/guide/en/elasticsearch/guide/master/using-synonyms.html files must be present, but it does not mention how.

Also, I found this: https://github.com/lindstromhenrik/elasticsearch-analysis-file-watcher-synonym not sure if it is working. Date on it does not seem too promising.

krinker
  • 1,072
  • 1
  • 9
  • 23

2 Answers2

0

How to distributed the file is out of scope of my abilities to answer your question, however:

An external file for "Synonyms", like "StopWords", are read in two circumstances:

  • when you create the Analyzer
  • when you restart your node

The guide has a section on how to update the stopwords list. This applies to synonyms as well.

In my practice I found it easier to provide the synonyms directly within the JSON payload. Safes me from "knowing too much" about the actual infrastructure regarding servers, file locations, etc.

mark
  • 6,308
  • 8
  • 46
  • 57
0

So... it seems that you have to use such thing as Puppet or Chef. Weird that ES would make it so complicated.

Synonym files must be replicated exactly between hosts. If this is not carefully managed bad things can happen. At Found, this is done automatically when you upload a custom bundle with a synonyms file in it. If you manage your own servers, be sure to use a configuration management tool like Ansible, Chef, or Puppet to synchronize these files between hosts, otherwise you may find that synonyms are interepreted differently depending on which host is handling which requests.

https://www.found.no/foundation/text-analysis-part-2/

krinker
  • 1,072
  • 1
  • 9
  • 23