How to dynamically change synonyms for ElasticSearch

后端 未结 5 1390
执念已碎
执念已碎 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 05:57

    I know this is an old thread but as of ES 7.5 they have added a new feature to update synonyms. Have a look at their documentation.

    You need to issue a POST api like this POST /twitter/_reload_search_analyzers

    This would reload all the search analyzers, also ensure that the synonym token filter have the updateable flag set to true like this "updatedable": true.

    PS: This feature is part of X-Pack and comes under the basic license which is free.

提交回复
热议问题