I'm quite new to ElasticSearch, so please forgive me if I overlook something obvious/basic.
I'd like to change the settings of analyzers/tokenizers/filters, and then apply them to existing indices. The only way I can come up with is the following:
- create a new index.
- Suppose you want to change the setting of
posts
index, createposts-copy
index.
- Suppose you want to change the setting of
- reindex
posts
toposts-copy
. - delete
posts
. - re-create
posts
index, applying the new settings. - re-reindex
posts-copy
toposts
. - delete
posts-copy
.
I tried this way using Ruby client of ElasticSearch, and it looked like it worked. However, I'm not sure if this approach really is proper. And I feel like it's quite redundant and there might be more efficient way of applying new settings.
I would appreciate it if you shed some lights on this problem.
CodePudding user response:
It depends what type of changes are you doing on analyzers/tokenizers/filters
, if you are changing it on existing fields than these are breaking changes and you have to recreate the indices with new settings(like you mentioned), but if you are adding a new fields in the index and for that you are creating new settings, than you don't have to recreate the index, its called incremental changes.
Hope this helps.