Does NEST support updating index analysis?

对着背影说爱祢 提交于 2019-12-11 06:46:25

问题


As written in the elasticSearch documentation here, it's possible to define a new analysis for an index (I tried and it worked fine).

I was wondering if it was possible to perform the same thing with NEST?

I tried this:

ElasticClient.CloseIndex("myindex");
IndexSettings ndxSettings = ElasticClient.GetIndexSettings("myindex").Settings; 
ndxSettings.Analysis.Analyzers.Add("snbowball", new SnowballAnalyzer());
var r = ElasticClient.UpdateSettings("myindex", ndxSettings);
ElasticClient.OpenIndex("myindex");

No error but nothing has changed.

When I try to see if the analyser has been added:

var getResponse = ElasticClient.GetIndexSettings("myindex");

getResponse.Settings.Analysis.Analyzers contains nothing.


回答1:


You're doing the right thing, but analysis settings currently aren't on the UpdateWhiteList in NEST:

https://github.com/Mpdreamz/NEST/blob/master/src/Nest/Domain/Settings/IndexSettings.cs



来源:https://stackoverflow.com/questions/18062308/does-nest-support-updating-index-analysis

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!