在 Elasticsearch 5 中更改映射 属性 分析器
Change mapping property analyzer in Elasticsearch 5
我已经在 ES 上创建了一个映射索引。
我需要更换 属性 分析仪以使用新的分析仪。我能够将新分析器添加到索引中,但是在尝试更新映射 属性 以使用新分析器时出现异常。
我的代码:
var closeIndexResult = client.CloseIndex("index");
var result = client.Map<MyEntity>(m => m.Properties(prop =>
prop.Text(t => t.Name(n => n.FirstName).Analyzer("myNewAnalizer"))
));
Result here is not successful...
我正在使用 ES 5 和 Nest。
有没有办法更新我当前的 属性 数据以使用新的分析器而无需重新索引我的所有数据?
没有。映射决定了数据的索引方式,这意味着对它的任何更改都会使当前索引与映射定义不一致
Although you can add new types to an index, or add new fields to a type, you can’t add new analyzers or make changes to existing fields. If you were to do so, the data that has already been indexed would be incorrect and your searches would no longer work as expected.
When you need to make changes to existing fields, you should look at reindexing your data with the Reindex API
https://www.elastic.co/guide/en/elasticsearch/client/net-api/master/writing-analyzers.html
我已经在 ES 上创建了一个映射索引。
我需要更换 属性 分析仪以使用新的分析仪。我能够将新分析器添加到索引中,但是在尝试更新映射 属性 以使用新分析器时出现异常。
我的代码:
var closeIndexResult = client.CloseIndex("index");
var result = client.Map<MyEntity>(m => m.Properties(prop =>
prop.Text(t => t.Name(n => n.FirstName).Analyzer("myNewAnalizer"))
));
Result here is not successful...
我正在使用 ES 5 和 Nest。
有没有办法更新我当前的 属性 数据以使用新的分析器而无需重新索引我的所有数据?
没有。映射决定了数据的索引方式,这意味着对它的任何更改都会使当前索引与映射定义不一致
Although you can add new types to an index, or add new fields to a type, you can’t add new analyzers or make changes to existing fields. If you were to do so, the data that has already been indexed would be incorrect and your searches would no longer work as expected.
When you need to make changes to existing fields, you should look at reindexing your data with the Reindex API
https://www.elastic.co/guide/en/elasticsearch/client/net-api/master/writing-analyzers.html