How to dynamically change synonyms for ElasticSearch

后端 未结 5 1393
执念已碎
执念已碎 2021-02-06 05:22

My synonyms are stored in a database and, when the synonyms are changed in the database, I want to update any values in the index which may be changed as a result of the synonym

5条回答
  •  独厮守ぢ
    2021-02-06 06:03

    I know this is an old thread, but in case it helps someone. The answer can be found here:

    If you specify stopwords inline with the stopwords parameter, your only option is to close the index and update the analyzer configuration with the update index settings API, then reopen the index.

    Updating stopwords is easier if you specify them in a file with the stopwords_path parameter. You can just update the file (on every node in the cluster) and then force the analyzers to be re-created by either of these actions:

    Closing and reopening the index (see open/close index), or Restarting each node in the cluster, one by one

提交回复
热议问题