MaxSC
MaxSC

Reputation: 4758

Does NEST support updating index analysis?

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.

Upvotes: 1

Views: 869

Answers (1)

Max
Max

Reputation: 9879

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

Upvotes: 1

Related Questions