Release notes v8.0.4

edit

Bug fixes

edit
  • Fix code-gen for IndexSettingsAnalysis (issue: #7118)
  • Complete implementation of Metrics type
  • Update generated code with fixes from 8.6 specification (issue: #7119). Adds Missing property to MultiTermLookup.

Breaking changes

edit

In the course of fixing the code-generation of types used on IndexSettingsAnalysis, several breaking changes were introduced. Some of these were necessary to make the types usable, while others fixed the consistency of the generated code.

IndexSettingsAnalysis

edit

Code-generation has been updated to apply transforms to fix the specification of the IndexSettingsAnalysis type. As a result, all properties have been renamed, and some property types have been changed.

  • The Analyzer property is now pluralized and renamed to Analyzers to align with NEST and make it clearer that this can contain more than one analyzer definition.
  • The CharFilter property is now pluralized and renamed to CharFilters to align with NEST and make it clearer that this can contain more than one char filter definition. Its type has changes from a IDictionary<string, Elastic.Clients.Elasticsearch.Analysis.CharFilter> to CharFilters, a tagged union type deriving from IsADictionary<string, ICharFilter>`.
  • The Filter property is now pluralized and renamed to TokenFilters to align with NEST and make it clearer that this can contain more than one token filter definition. Its type has changes from a IDictionary<string, Elastic.Clients.Elasticsearch.Analysis.TokenFilter> to TokenFilters, a tagged union type deriving from IsADictionary<string, ITokenFilter>`.
  • The Normalizer property is now pluralized and renamed to Normalizers to align with NEST and make it clearer that this can contain more than one normalizer definition.
  • The Tokenizer property is now pluralized and renamed to Tokenizers to align with NEST and make it clearer that this can contain more than one tokenizer definition. Its type has changes from a IDictionary<string, Elastic.Clients.Elasticsearch.Analysis.Tokenizer> to TokenFilters, a tagged union type deriving from IsADictionary<string, ITokenizer>`.

Before

public sealed partial class IndexSettingsAnalysis
{
   public Elastic.Clients.Elasticsearch.Analysis.Analyzers? Analyzer { get; set; }
   public IDictionary<string, Elastic.Clients.Elasticsearch.Analysis.CharFilter>? CharFilter { get; set; }
   public IDictionary<string, Elastic.Clients.Elasticsearch.Analysis.TokenFilter>? Filter { get; set; }
   public Elastic.Clients.Elasticsearch.Analysis.Normalizers? Normalizer { get; set; }
   public IDictionary<string, Elastic.Clients.Elasticsearch.Analysis.Tokenizer>? Tokenizer { get; set; }
}

After

public sealed partial class IndexSettingsAnalysis
{
   public Elastic.Clients.Elasticsearch.Analysis.Analyzers? Analyzers { get; set; }
   public Elastic.Clients.Elasticsearch.Analysis.CharFilters? CharFilters { get; set; }
   public Elastic.Clients.Elasticsearch.Analysis.TokenFilters? TokenFilters { get; set; }
   public Elastic.Clients.Elasticsearch.Analysis.Normalizers? Normalizers { get; set; }
   public Elastic.Clients.Elasticsearch.Analysis.Tokenizers? Tokenizers { get; set; }
}

The IndexSettingsAnalysisDescriptor type has been updated accordingly to apply the above changes. It now supports a more convenient syntax to easily define the filters, normalizers and tokenizers that apply to the settings for indices.

Example usage of updated fluent syntax:
edit
var descriptor = new CreateIndexRequestDescriptor("test")
   .Settings(s => s
      .Analysis(a => a
         .Analyzers(a => a
            .Stop("stop-name", stop => stop.StopwordsPath("analysis/path.txt"))
            .Pattern("pattern-name", pattern => pattern.Version("version"))
            .Custom("my-custom-analyzer", c => c
               .Filter(new[] { "stop", "synonym" })
               .Tokenizer("standard")))
         .TokenFilters(f => f
            .Synonym("synonym", synonym => synonym
               .SynonymsPath("analysis/synonym.txt")))));

Token Filters

edit

Token filter types now implement the ITokenFilter interface, rather than ITokenFilterDefinition.

The TokenFilter union type has been renamed to CategorizationTokenFilter to clearly signify it’s use only within ML categorization contexts.

A TokenFilters type has been introduced, which derives from IsADictionary and supports convenient addition of known token filters via the fluent API.

Character Filters

edit

Character filter types now implement the ICharFilter interface, rather than ICharFilterDefinition.

The CharFilter union type has been renamed to CategorizationCharFilter to clearly signify it’s use only within ML categorization contexts.

A CharFilters type has been introduced, which derives from IsADictionary and supports convenient addition of known character filters via the fluent API.

Tokenizers

edit

Tokenizer types now implement the ITokenizer interface, rather than ITokenizerDefinition.

The Tokenizer union type has been renamed to CategorizationTokenizer to clearly signify it’s use only within ML categorization contexts.

A Tokenizers type has been introduced, which derives from IsADictionary and supports convenient addition of known tokenizers via the fluent API.

IndexManagement.StorageType

edit

The 8.6 specification fixed this type to mark is as a non-exhaustive enum, since it supports additional values besides those coded into the specification. As a result the code-generation for this type causes some breaking changes. The type is no longer generated as an enum and is not a custom readonly struct.