Stopwords/synonyms/etc 个 ElasticSearch 文件

Stopwords/synonyms/etc file for ElasticSearch

我曾经使用 Solr,它会有包含停用词、同义词等文件的配置文件夹。每次您要进行更改时,您都可以使用 Zookeeper 下载 conf 文件,然后将其上传并分发到集群中的所有服务器。

ElasticSearch 的新手,请原谅这个问题:有没有办法让我自动创建此类文件并让 Zookeeper 或其他工具自动分发它,而不是手动步骤(或 Puppet 脚本)

据此:http://www.elastic.co/guide/en/elasticsearch/guide/master/using-synonyms.html 文件必须存在,但没有提及如何存在。

另外,我发现了这个:https://github.com/lindstromhenrik/elasticsearch-analysis-file-watcher-synonym 不确定它是否有效。日期似乎不太乐观。

如何分发文件超出了我回答您问题的能力范围,但是:

"Synonyms" 的外部文件,如 "StopWords",在两种情况下被读取:

  • 当您创建分析器时
  • 当您重新启动节点时

该指南有一节介绍如何 update the stopwords 列出。这也适用于同义词。

在我的实践中,我发现直接在 JSON 负载中提供同义词更容易。让我远离 "knowing too much" 有关服务器、文件位置等实际基础设施的问题。

所以...看来您必须使用 Puppet 或 Chef 之类的东西。奇怪的是 ES 会让它变得如此复杂。

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/