From 8312954f15e857ec3685a55d9f1ee71b6a7a0cd4 Mon Sep 17 00:00:00 2001 From: Steve Gordon Date: Tue, 20 Dec 2022 14:33:02 +0000 Subject: [PATCH 1/4] Add release notes for 8.0.4 --- .../breaking-change-policy.asciidoc | 4 +- .../release-notes-8.0.4.asciidoc | 128 ++++++++++++++++++ docs/release-notes/release-notes.asciidoc | 4 +- 3 files changed, 134 insertions(+), 2 deletions(-) create mode 100644 docs/release-notes/release-notes-8.0.4.asciidoc diff --git a/docs/release-notes/breaking-change-policy.asciidoc b/docs/release-notes/breaking-change-policy.asciidoc index 7e1eb4873b2..74138bc005f 100644 --- a/docs/release-notes/breaking-change-policy.asciidoc +++ b/docs/release-notes/breaking-change-policy.asciidoc @@ -12,7 +12,9 @@ This section explains how these breaking changes are considered for inclusion in Some issues in the API specification are properties that have an incorrect type, such as a `long` that should be a `string`, or a required property that is actually optional. These issues can cause the {net-client} to not work properly or even throw exceptions. -When a specification issue is discovered and resolved, it may require code updates in applications using the {net-client}. Such breaking changes are considered acceptable, _even in patch releases_ (e.g. 7.17.0 -> 7.17.1), as they introduce stability to APIs that may otherwise be unusable. +When a specification issue is discovered and resolved, it may require code updates in applications using the {net-client}. Such breaking changes are considered acceptable, _even in patch releases_ (e.g. 8.0.0 -> 8.0.1), as they introduce stability to APIs that may otherwise be unusable. + +We may also make breaking changes in patch releases to correct design flaws and code-generation issues that we deem beneficial to resolve at the earliest oppotunity. We will detail these in the relevant release notes and limit these as the client matures. [discrete] ==== Breaking changes in minor releases diff --git a/docs/release-notes/release-notes-8.0.4.asciidoc b/docs/release-notes/release-notes-8.0.4.asciidoc new file mode 100644 index 00000000000..215f068f32c --- /dev/null +++ b/docs/release-notes/release-notes-8.0.4.asciidoc @@ -0,0 +1,128 @@ +[[release-notes-8.0.4]] +== Release notes v8.0.4 + +[discrete] +=== Bug fixes + +- Fix code-gen for IndexSettingsAnalysis (issue: +https://github.com/elastic/elasticsearch-net/issues/7118[#7118]) + +[discrete] +=== Breaking changes + +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. + +[discrete] +==== IndexSettingsAnalysis + +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` +to `CharFilters`, a tagged union type deriving from IsADictionary`. +* 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` +to `TokenFilters`, a tagged union type deriving from IsADictionary`. +* 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` +to `TokenFilters`, a tagged union type deriving from IsADictionary`. + +[discrete] +===== Before + +[source,csharp] +---- +public sealed partial class IndexSettingsAnalysis +{ + public Elastic.Clients.Elasticsearch.Analysis.Analyzers? Analyzer { get; set; } + public IDictionary? CharFilter { get; set; } + public IDictionary? Filter { get; set; } + public Elastic.Clients.Elasticsearch.Analysis.Normalizers? Normalizer { get; set; } + public IDictionary? Tokenizer { get; set; } +} +---- + +[discrete] +===== After + +[source,csharp] +---- +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. + +[discrete] +===== Example usage of updated fluent syntax: + +[source,csharp] +---- +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"))))); +---- + +[discrete] +==== Token Filters + +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. + +[discrete] +==== Character Filters + +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. + +[discrete] +==== Tokenizers + +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. \ No newline at end of file diff --git a/docs/release-notes/release-notes.asciidoc b/docs/release-notes/release-notes.asciidoc index 00dd1de7df3..520c4337d74 100644 --- a/docs/release-notes/release-notes.asciidoc +++ b/docs/release-notes/release-notes.asciidoc @@ -4,14 +4,16 @@ * <> [discrete] -== Version 8.x +== Version 8.0 +* <> * <> * <> * <> * <> include::breaking-change-policy.asciidoc[] +include::release-notes-8.0.4.asciidoc[] include::release-notes-8.0.3.asciidoc[] include::release-notes-8.0.2.asciidoc[] include::release-notes-8.0.1.asciidoc[] From f7f7c0a389d2e39f9d96af68527d38255541e8f5 Mon Sep 17 00:00:00 2001 From: Steve Gordon Date: Tue, 20 Dec 2022 16:06:37 +0000 Subject: [PATCH 2/4] Tweak formatting --- .../release-notes-8.0.4.asciidoc | 48 +++++++++---------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/docs/release-notes/release-notes-8.0.4.asciidoc b/docs/release-notes/release-notes-8.0.4.asciidoc index 215f068f32c..367f19dbece 100644 --- a/docs/release-notes/release-notes-8.0.4.asciidoc +++ b/docs/release-notes/release-notes-8.0.4.asciidoc @@ -38,33 +38,31 @@ NEST and make it clearer that this can contain more than one tokenizer definitio Its type has changes from a `IDictionary` to `TokenFilters`, a tagged union type deriving from IsADictionary`. -[discrete] -===== Before +*_Before_* [source,csharp] ---- public sealed partial class IndexSettingsAnalysis { - public Elastic.Clients.Elasticsearch.Analysis.Analyzers? Analyzer { get; set; } - public IDictionary? CharFilter { get; set; } - public IDictionary? Filter { get; set; } - public Elastic.Clients.Elasticsearch.Analysis.Normalizers? Normalizer { get; set; } - public IDictionary? Tokenizer { get; set; } + public Elastic.Clients.Elasticsearch.Analysis.Analyzers? Analyzer { get; set; } + public IDictionary? CharFilter { get; set; } + public IDictionary? Filter { get; set; } + public Elastic.Clients.Elasticsearch.Analysis.Normalizers? Normalizer { get; set; } + public IDictionary? Tokenizer { get; set; } } ---- -[discrete] -===== After +*_After_* [source,csharp] ---- 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; } + 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; } } ---- @@ -78,17 +76,17 @@ the filters, normalizers and tokenizers that apply to the settings for indices. [source,csharp] ---- 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"))))); + .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"))))); ---- [discrete] From f35c9707064a655725165cd038375bafd5ba8319 Mon Sep 17 00:00:00 2001 From: Steve Gordon Date: Wed, 21 Dec 2022 09:37:31 +0000 Subject: [PATCH 3/4] Add additional PR to list of bug fixes --- docs/release-notes/release-notes-8.0.4.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/release-notes/release-notes-8.0.4.asciidoc b/docs/release-notes/release-notes-8.0.4.asciidoc index 367f19dbece..84458bc784b 100644 --- a/docs/release-notes/release-notes-8.0.4.asciidoc +++ b/docs/release-notes/release-notes-8.0.4.asciidoc @@ -6,6 +6,7 @@ - Fix code-gen for IndexSettingsAnalysis (issue: https://github.com/elastic/elasticsearch-net/issues/7118[#7118]) +- Complete implementation of Metrics type [discrete] === Breaking changes From 8b628378c227e2e76992768b1c35d68c17b0ef2a Mon Sep 17 00:00:00 2001 From: Steve Gordon Date: Wed, 21 Dec 2022 12:13:52 +0000 Subject: [PATCH 4/4] Add breaking change notification for StorageType --- docs/release-notes/release-notes-8.0.4.asciidoc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/release-notes-8.0.4.asciidoc b/docs/release-notes/release-notes-8.0.4.asciidoc index 84458bc784b..ac61771ebde 100644 --- a/docs/release-notes/release-notes-8.0.4.asciidoc +++ b/docs/release-notes/release-notes-8.0.4.asciidoc @@ -7,6 +7,9 @@ - Fix code-gen for IndexSettingsAnalysis (issue: https://github.com/elastic/elasticsearch-net/issues/7118[#7118]) - Complete implementation of Metrics type +- Update generated code with fixes from 8.6 specification (issue: +https://github.com/elastic/elasticsearch-net/issues/7119[#7119]). Adds `Missing` +property to `MultiTermLookup`. [discrete] === Breaking changes @@ -124,4 +127,12 @@ 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. \ No newline at end of file +supports convenient addition of known tokenizers via the fluent API. + +[discrete] +==== IndexManagement.StorageType + +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`. \ No newline at end of file