|
| 1 | +[[release-notes-8.0.4]] |
| 2 | +== Release notes v8.0.4 |
| 3 | + |
| 4 | +[discrete] |
| 5 | +=== Bug fixes |
| 6 | + |
| 7 | +- Fix code-gen for IndexSettingsAnalysis (issue: |
| 8 | +https://github.com/elastic/elasticsearch-net/issues/7118[#7118]) |
| 9 | +- Complete implementation of Metrics type |
| 10 | +- Update generated code with fixes from 8.6 specification (issue: |
| 11 | +https://github.com/elastic/elasticsearch-net/issues/7119[#7119]). Adds `Missing` |
| 12 | +property to `MultiTermLookup`. |
| 13 | + |
| 14 | +[discrete] |
| 15 | +=== Breaking changes |
| 16 | + |
| 17 | +In the course of fixing the code-generation of types used on `IndexSettingsAnalysis`, |
| 18 | +several breaking changes were introduced. Some of these were necessary to make the |
| 19 | +types usable, while others fixed the consistency of the generated code. |
| 20 | + |
| 21 | +[discrete] |
| 22 | +==== IndexSettingsAnalysis |
| 23 | + |
| 24 | +Code-generation has been updated to apply transforms to fix the specification |
| 25 | +of the `IndexSettingsAnalysis` type. As a result, all properties have been renamed, |
| 26 | +and some property types have been changed. |
| 27 | + |
| 28 | +* The `Analyzer` property is now pluralized and renamed to `Analyzers` to align with |
| 29 | +NEST and make it clearer that this can contain more than one analyzer definition. |
| 30 | +* The `CharFilter` property is now pluralized and renamed to `CharFilters` to align with |
| 31 | +NEST and make it clearer that this can contain more than one char filter definition. |
| 32 | +Its type has changes from a `IDictionary<string, Elastic.Clients.Elasticsearch.Analysis.CharFilter>` |
| 33 | +to `CharFilters`, a tagged union type deriving from IsADictionary<string, ICharFilter>`. |
| 34 | +* The `Filter` property is now pluralized and renamed to `TokenFilters` to align with |
| 35 | +NEST and make it clearer that this can contain more than one token filter definition. |
| 36 | +Its type has changes from a `IDictionary<string, Elastic.Clients.Elasticsearch.Analysis.TokenFilter>` |
| 37 | +to `TokenFilters`, a tagged union type deriving from IsADictionary<string, ITokenFilter>`. |
| 38 | +* The `Normalizer` property is now pluralized and renamed to `Normalizers` to align with |
| 39 | +NEST and make it clearer that this can contain more than one normalizer definition. |
| 40 | +* The `Tokenizer` property is now pluralized and renamed to `Tokenizers` to align with |
| 41 | +NEST and make it clearer that this can contain more than one tokenizer definition. |
| 42 | +Its type has changes from a `IDictionary<string, Elastic.Clients.Elasticsearch.Analysis.Tokenizer>` |
| 43 | +to `TokenFilters`, a tagged union type deriving from IsADictionary<string, ITokenizer>`. |
| 44 | + |
| 45 | +*_Before_* |
| 46 | + |
| 47 | +[source,csharp] |
| 48 | +---- |
| 49 | +public sealed partial class IndexSettingsAnalysis |
| 50 | +{ |
| 51 | + public Elastic.Clients.Elasticsearch.Analysis.Analyzers? Analyzer { get; set; } |
| 52 | + public IDictionary<string, Elastic.Clients.Elasticsearch.Analysis.CharFilter>? CharFilter { get; set; } |
| 53 | + public IDictionary<string, Elastic.Clients.Elasticsearch.Analysis.TokenFilter>? Filter { get; set; } |
| 54 | + public Elastic.Clients.Elasticsearch.Analysis.Normalizers? Normalizer { get; set; } |
| 55 | + public IDictionary<string, Elastic.Clients.Elasticsearch.Analysis.Tokenizer>? Tokenizer { get; set; } |
| 56 | +} |
| 57 | +---- |
| 58 | + |
| 59 | +*_After_* |
| 60 | + |
| 61 | +[source,csharp] |
| 62 | +---- |
| 63 | +public sealed partial class IndexSettingsAnalysis |
| 64 | +{ |
| 65 | + public Elastic.Clients.Elasticsearch.Analysis.Analyzers? Analyzers { get; set; } |
| 66 | + public Elastic.Clients.Elasticsearch.Analysis.CharFilters? CharFilters { get; set; } |
| 67 | + public Elastic.Clients.Elasticsearch.Analysis.TokenFilters? TokenFilters { get; set; } |
| 68 | + public Elastic.Clients.Elasticsearch.Analysis.Normalizers? Normalizers { get; set; } |
| 69 | + public Elastic.Clients.Elasticsearch.Analysis.Tokenizers? Tokenizers { get; set; } |
| 70 | +} |
| 71 | +---- |
| 72 | + |
| 73 | +The `IndexSettingsAnalysisDescriptor` type has been updated accordingly to apply |
| 74 | +the above changes. It now supports a more convenient syntax to easily define |
| 75 | +the filters, normalizers and tokenizers that apply to the settings for indices. |
| 76 | + |
| 77 | +[discrete] |
| 78 | +===== Example usage of updated fluent syntax: |
| 79 | + |
| 80 | +[source,csharp] |
| 81 | +---- |
| 82 | +var descriptor = new CreateIndexRequestDescriptor("test") |
| 83 | + .Settings(s => s |
| 84 | + .Analysis(a => a |
| 85 | + .Analyzers(a => a |
| 86 | + .Stop("stop-name", stop => stop.StopwordsPath("analysis/path.txt")) |
| 87 | + .Pattern("pattern-name", pattern => pattern.Version("version")) |
| 88 | + .Custom("my-custom-analyzer", c => c |
| 89 | + .Filter(new[] { "stop", "synonym" }) |
| 90 | + .Tokenizer("standard"))) |
| 91 | + .TokenFilters(f => f |
| 92 | + .Synonym("synonym", synonym => synonym |
| 93 | + .SynonymsPath("analysis/synonym.txt"))))); |
| 94 | +---- |
| 95 | + |
| 96 | +[discrete] |
| 97 | +==== Token Filters |
| 98 | + |
| 99 | +Token filter types now implement the `ITokenFilter` interface, rather than |
| 100 | +`ITokenFilterDefinition`. |
| 101 | + |
| 102 | +The `TokenFilter` union type has been renamed to `CategorizationTokenFilter` to |
| 103 | +clearly signify it's use only within ML categorization contexts. |
| 104 | + |
| 105 | +A `TokenFilters` type has been introduced, which derives from `IsADictionary` and |
| 106 | +supports convenient addition of known token filters via the fluent API. |
| 107 | + |
| 108 | +[discrete] |
| 109 | +==== Character Filters |
| 110 | + |
| 111 | +Character filter types now implement the `ICharFilter` interface, rather than |
| 112 | +`ICharFilterDefinition`. |
| 113 | + |
| 114 | +The `CharFilter` union type has been renamed to `CategorizationCharFilter` to |
| 115 | +clearly signify it's use only within ML categorization contexts. |
| 116 | + |
| 117 | +A `CharFilters` type has been introduced, which derives from `IsADictionary` and |
| 118 | +supports convenient addition of known character filters via the fluent API. |
| 119 | + |
| 120 | +[discrete] |
| 121 | +==== Tokenizers |
| 122 | + |
| 123 | +Tokenizer types now implement the `ITokenizer` interface, rather than |
| 124 | +`ITokenizerDefinition`. |
| 125 | + |
| 126 | +The `Tokenizer` union type has been renamed to `CategorizationTokenizer` to |
| 127 | +clearly signify it's use only within ML categorization contexts. |
| 128 | + |
| 129 | +A `Tokenizers` type has been introduced, which derives from `IsADictionary` and |
| 130 | +supports convenient addition of known tokenizers via the fluent API. |
| 131 | + |
| 132 | +[discrete] |
| 133 | +==== IndexManagement.StorageType |
| 134 | + |
| 135 | +The 8.6 specification fixed this type to mark is as a non-exhaustive enum, since |
| 136 | +it supports additional values besides those coded into the specification. As a |
| 137 | +result the code-generation for this type causes some breaking changes. The type |
| 138 | +is no longer generated as an `enum` and is not a custom `readonly struct`. |
0 commit comments