From 6711adccb0e18efce70d2550613e13bc1d0c153a Mon Sep 17 00:00:00 2001 From: Florian Bernd Date: Thu, 8 May 2025 16:08:11 +0200 Subject: [PATCH] Regenerate client --- .../Api/Cluster/ClusterStatsResponse.g.cs | 20 + .../_Generated/Api/CreateRequest.g.cs | 4 +- .../IndexManagement/CreateIndexRequest.g.cs | 114 +++ .../_Generated/Api/IndexRequest.g.cs | 4 +- .../ChatCompletionUnifiedRequest.g.cs | 28 + .../Api/Inference/PutAlibabacloudRequest.g.cs | 14 - .../Inference/PutAmazonbedrockRequest.g.cs | 14 - .../Api/Inference/PutAnthropicRequest.g.cs | 14 - .../Inference/PutAzureaistudioRequest.g.cs | 14 - .../Api/Inference/PutAzureopenaiRequest.g.cs | 14 - .../Api/Inference/PutCohereRequest.g.cs | 14 - .../Inference/PutGoogleaistudioRequest.g.cs | 14 - .../Inference/PutGooglevertexaiRequest.g.cs | 14 - .../Api/Inference/PutHuggingFaceRequest.g.cs | 14 - .../Api/Inference/PutInferenceRequest.g.cs | 10 - .../Api/Inference/PutJinaaiRequest.g.cs | 14 - .../Api/Inference/PutMistralRequest.g.cs | 14 - .../Api/Inference/PutOpenaiRequest.g.cs | 18 +- .../Api/Inference/PutWatsonxRequest.g.cs | 14 - .../_Generated/Api/SearchRequest.g.cs | 32 + .../Types/Analysis/ApostropheTokenFilter.g.cs | 134 +++ .../Types/Analysis/ArabicAnalyzer.g.cs | 16 +- .../ArabicNormalizationTokenFilter.g.cs | 134 +++ .../Types/Analysis/ArmenianAnalyzer.g.cs | 16 +- .../Analysis/AsciiFoldingTokenFilter.g.cs | 10 + .../Types/Analysis/BasqueAnalyzer.g.cs | 16 +- .../Types/Analysis/BengaliAnalyzer.g.cs | 16 +- .../Types/Analysis/BrazilianAnalyzer.g.cs | 16 +- .../Types/Analysis/BulgarianAnalyzer.g.cs | 16 +- .../Types/Analysis/CatalanAnalyzer.g.cs | 16 +- .../Types/Analysis/ChineseAnalyzer.g.cs | 16 +- .../Types/Analysis/CjkAnalyzer.g.cs | 16 +- .../Types/Analysis/CjkBigramTokenFilter.g.cs | 199 ++++ .../Types/Analysis/CjkWidthTokenFilter.g.cs | 134 +++ .../Types/Analysis/ClassicTokenFilter.g.cs | 134 +++ .../Analysis/CommonGramsTokenFilter.g.cs | 81 ++ .../Types/Analysis/ConditionTokenFilter.g.cs | 36 + .../Types/Analysis/CzechAnalyzer.g.cs | 16 +- .../Types/Analysis/DanishAnalyzer.g.cs | 16 +- .../Analysis/DecimalDigitTokenFilter.g.cs | 134 +++ .../Analysis/DelimitedPayloadTokenFilter.g.cs | 21 + .../DictionaryDecompounderTokenFilter.g.cs | 93 +- .../Types/Analysis/DutchAnalyzer.g.cs | 16 +- .../Types/Analysis/EdgeNGramTokenFilter.g.cs | 43 + .../Types/Analysis/ElisionTokenFilter.g.cs | 49 + .../Types/Analysis/EnglishAnalyzer.g.cs | 16 +- .../Types/Analysis/EstonianAnalyzer.g.cs | 16 +- .../Types/Analysis/FingerprintAnalyzer.g.cs | 22 +- .../Analysis/FingerprintTokenFilter.g.cs | 21 + .../Types/Analysis/FinnishAnalyzer.g.cs | 16 +- .../Analysis/FlattenGraphTokenFilter.g.cs | 134 +++ .../Types/Analysis/FrenchAnalyzer.g.cs | 16 +- .../Types/Analysis/GalicianAnalyzer.g.cs | 16 +- .../Types/Analysis/GermanAnalyzer.g.cs | 16 +- .../GermanNormalizationTokenFilter.g.cs | 134 +++ .../Types/Analysis/GreekAnalyzer.g.cs | 16 +- .../Types/Analysis/HindiAnalyzer.g.cs | 16 +- .../HindiNormalizationTokenFilter.g.cs | 134 +++ .../Types/Analysis/HungarianAnalyzer.g.cs | 16 +- .../Types/Analysis/HunspellTokenFilter.g.cs | 49 +- .../HyphenationDecompounderTokenFilter.g.cs | 167 +++- .../Analysis/IcuNormalizationCharFilter.g.cs | 16 + .../IndicNormalizationTokenFilter.g.cs | 134 +++ .../Types/Analysis/IndonesianAnalyzer.g.cs | 16 +- .../Types/Analysis/IrishAnalyzer.g.cs | 16 +- .../Types/Analysis/ItalianAnalyzer.g.cs | 16 +- .../Types/Analysis/JaStopTokenFilter.g.cs | 151 +++ .../Types/Analysis/KeepTypesTokenFilter.g.cs | 52 +- .../Types/Analysis/KeepWordsTokenFilter.g.cs | 44 + .../Analysis/KeywordMarkerTokenFilter.g.cs | 57 ++ .../Analysis/KeywordRepeatTokenFilter.g.cs | 134 +++ .../Types/Analysis/LatvianAnalyzer.g.cs | 16 +- .../Types/Analysis/LengthTokenFilter.g.cs | 21 + .../Analysis/LimitTokenCountTokenFilter.g.cs | 21 + .../Types/Analysis/LithuanianAnalyzer.g.cs | 16 +- .../Types/Analysis/LowercaseTokenFilter.g.cs | 16 +- .../Types/Analysis/MinHashTokenFilter.g.cs | 244 +++++ .../Analysis/MultiplexerTokenFilter.g.cs | 26 + .../Types/Analysis/NGramTokenFilter.g.cs | 32 + .../Analysis/NoriPartOfSpeechTokenFilter.g.cs | 15 + .../Types/Analysis/NorwegianAnalyzer.g.cs | 16 +- .../Types/Analysis/PatternAnalyzer.g.cs | 22 +- .../Analysis/PatternCaptureTokenFilter.g.cs | 26 + .../Analysis/PatternReplaceTokenFilter.g.cs | 48 +- .../Types/Analysis/PersianAnalyzer.g.cs | 16 +- .../PersianNormalizationTokenFilter.g.cs | 134 +++ .../Types/Analysis/PortugueseAnalyzer.g.cs | 16 +- .../Types/Analysis/PredicateTokenFilter.g.cs | 20 + .../Types/Analysis/RomanianAnalyzer.g.cs | 16 +- .../Types/Analysis/RussianAnalyzer.g.cs | 16 +- .../ScandinavianFoldingTokenFilter.g.cs | 134 +++ .../ScandinavianNormalizationTokenFilter.g.cs | 134 +++ .../Types/Analysis/SerbianAnalyzer.g.cs | 16 +- .../SerbianNormalizationTokenFilter.g.cs | 134 +++ .../Types/Analysis/ShingleTokenFilter.g.cs | 85 +- .../Types/Analysis/SnowballAnalyzer.g.cs | 16 +- .../Types/Analysis/SnowballTokenFilter.g.cs | 10 + .../Types/Analysis/SoraniAnalyzer.g.cs | 16 +- .../SoraniNormalizationTokenFilter.g.cs | 134 +++ .../Types/Analysis/SpanishAnalyzer.g.cs | 16 +- .../Types/Analysis/StandardAnalyzer.g.cs | 22 +- .../Analysis/StemmerOverrideTokenFilter.g.cs | 26 + .../Types/Analysis/StopAnalyzer.g.cs | 22 +- .../Types/Analysis/StopTokenFilter.g.cs | 61 +- .../Types/Analysis/SwedishAnalyzer.g.cs | 16 +- .../Analysis/SynonymGraphTokenFilter.g.cs | 91 ++ .../Types/Analysis/SynonymTokenFilter.g.cs | 91 ++ .../Types/Analysis/ThaiAnalyzer.g.cs | 16 +- .../Types/Analysis/TokenFilter.g.cs | 356 ++++++- .../Types/Analysis/TokenFilters.g.cs | 340 ++++++- .../Types/Analysis/TruncateTokenFilter.g.cs | 10 + .../Types/Analysis/TurkishAnalyzer.g.cs | 16 +- .../Types/Analysis/UniqueTokenFilter.g.cs | 10 + .../WordDelimiterGraphTokenFilter.g.cs | 175 ++++ .../Analysis/WordDelimiterTokenFilter.g.cs | 153 +++ .../_Generated/Types/Cluster/CCSStats.g.cs | 134 +++ .../Types/Cluster/CCSUsageClusterStats.g.cs | 142 +++ .../Types/Cluster/CCSUsageStats.g.cs | 321 +++++++ .../Types/Cluster/CCSUsageTimeValue.g.cs | 142 +++ .../Types/Cluster/RemoteClusterInfo.g.cs | 379 ++++++++ .../Types/Enums/Enums.Analysis.g.cs | 886 ++++++++++++++++++ .../_Generated/Types/Enums/Enums.Ingest.g.cs | 114 +++ .../_Generated/Types/Enums/Enums.Watcher.g.cs | 122 --- .../Inference/RequestChatCompletion.g.cs | 8 + ...tion.g.cs => PipelineProcessorResult.g.cs} | 22 +- .../Types/Ingest/SimulateDocumentResult.g.cs | 8 +- .../Types/QueryDsl/MoreLikeThisQuery.g.cs | 36 +- 127 files changed, 7430 insertions(+), 954 deletions(-) create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ApostropheTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicNormalizationTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkBigramTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkWidthTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ClassicTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DecimalDigitTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FlattenGraphTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanNormalizationTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HindiNormalizationTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IndicNormalizationTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/JaStopTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordRepeatTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MinHashTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianNormalizationTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ScandinavianFoldingTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ScandinavianNormalizationTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SerbianNormalizationTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SoraniNormalizationTokenFilter.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageClusterStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageStats.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageTimeValue.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RemoteClusterInfo.g.cs delete mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Watcher.g.cs rename src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/{PipelineSimulation.g.cs => PipelineProcessorResult.g.cs} (82%) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsResponse.g.cs index 862976dff3..378d51cbc1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/ClusterStatsResponse.g.cs @@ -25,6 +25,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; internal sealed partial class ClusterStatsResponseConverter : System.Text.Json.Serialization.JsonConverter { + private static readonly System.Text.Json.JsonEncodedText PropCcs = System.Text.Json.JsonEncodedText.Encode("ccs"); private static readonly System.Text.Json.JsonEncodedText PropClusterName = System.Text.Json.JsonEncodedText.Encode("cluster_name"); private static readonly System.Text.Json.JsonEncodedText PropClusterUuid = System.Text.Json.JsonEncodedText.Encode("cluster_uuid"); private static readonly System.Text.Json.JsonEncodedText PropIndices = System.Text.Json.JsonEncodedText.Encode("indices"); @@ -36,6 +37,7 @@ internal sealed partial class ClusterStatsResponseConverter : System.Text.Json.S public override Elastic.Clients.Elasticsearch.Cluster.ClusterStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCcs = default; LocalJsonValue propClusterName = default; LocalJsonValue propClusterUuid = default; LocalJsonValue propIndices = default; @@ -45,6 +47,11 @@ public override Elastic.Clients.Elasticsearch.Cluster.ClusterStatsResponse Read( LocalJsonValue propTimestamp = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { + if (propCcs.TryReadProperty(ref reader, options, PropCcs, null)) + { + continue; + } + if (propClusterName.TryReadProperty(ref reader, options, PropClusterName, null)) { continue; @@ -92,6 +99,7 @@ public override Elastic.Clients.Elasticsearch.Cluster.ClusterStatsResponse Read( reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); return new Elastic.Clients.Elasticsearch.Cluster.ClusterStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { + Ccs = propCcs.Value, ClusterName = propClusterName.Value, ClusterUuid = propClusterUuid.Value, Indices = propIndices.Value, @@ -105,6 +113,7 @@ public override Elastic.Clients.Elasticsearch.Cluster.ClusterStatsResponse Read( public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ClusterStatsResponse value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); + writer.WriteProperty(options, PropCcs, value.Ccs, null, null); writer.WriteProperty(options, PropClusterName, value.ClusterName, null, null); writer.WriteProperty(options, PropClusterUuid, value.ClusterUuid, null, null); writer.WriteProperty(options, PropIndices, value.Indices, null, null); @@ -130,6 +139,17 @@ internal ClusterStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCo _ = sentinel; } + /// + /// + /// Cross-cluster stats + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + Elastic.Clients.Elasticsearch.Cluster.CCSStats Ccs { get; set; } + /// /// /// Name of the cluster, based on the cluster name setting. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CreateRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CreateRequest.g.cs index 34df65aae6..ab25ebebb6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CreateRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CreateRequest.g.cs @@ -283,13 +283,13 @@ public CreateRequest(TDocument document, Elastic.Clients.Elasticsearch.IndexName } [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public CreateRequest(TDocument document, Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("index", typeof(TDocument)).Required("id", id)) + public CreateRequest(TDocument document, Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("index", (Elastic.Clients.Elasticsearch.IndexName)typeof(TDocument)).Required("id", id)) { Document = document; } [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public CreateRequest(TDocument document) : base(r => r.Required("index", typeof(TDocument)).Required("id", Elastic.Clients.Elasticsearch.Id.From(document))) + public CreateRequest(TDocument document) : base(r => r.Required("index", (Elastic.Clients.Elasticsearch.IndexName)typeof(TDocument)).Required("id", Elastic.Clients.Elasticsearch.Id.From(document))) { Document = document; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexRequest.g.cs index efb3c6b30c..97b8b97663 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/CreateIndexRequest.g.cs @@ -176,7 +176,45 @@ internal CreateIndexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonCons /// /// /// Name of the index you wish to create. + /// Index names must meet the following criteria: /// + /// + /// + /// + /// Lowercase only + /// + /// + /// + /// + /// Cannot include \, /, *, ?, ", <, >, |, (space character), ,, or # + /// + /// + /// + /// + /// Indices prior to 7.0 could contain a colon (:), but that has been deprecated and will not be supported in later versions + /// + /// + /// + /// + /// Cannot start with -, _, or + + /// + /// + /// + /// + /// Cannot be . or .. + /// + /// + /// + /// + /// Cannot be longer than 255 bytes (note thtat it is bytes, so multi-byte characters will reach the limit faster) + /// + /// + /// + /// + /// Names starting with . are deprecated, except for hidden indices and internal indices managed by plugins + /// + /// + /// /// public #if NET7_0_OR_GREATER @@ -314,7 +352,45 @@ public CreateIndexRequestDescriptor() /// /// /// Name of the index you wish to create. + /// Index names must meet the following criteria: + /// + /// + /// + /// + /// Lowercase only + /// + /// + /// + /// + /// Cannot include \, /, *, ?, ", <, >, |, (space character), ,, or # + /// + /// + /// + /// + /// Indices prior to 7.0 could contain a colon (:), but that has been deprecated and will not be supported in later versions + /// + /// + /// + /// + /// Cannot start with -, _, or + + /// + /// + /// + /// + /// Cannot be . or .. + /// + /// + /// + /// + /// Cannot be longer than 255 bytes (note thtat it is bytes, so multi-byte characters will reach the limit faster) /// + /// + /// + /// + /// Names starting with . are deprecated, except for hidden indices and internal indices managed by plugins + /// + /// + /// /// public Elastic.Clients.Elasticsearch.IndexManagement.CreateIndexRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName value) { @@ -731,7 +807,45 @@ public CreateIndexRequestDescriptor() /// /// /// Name of the index you wish to create. + /// Index names must meet the following criteria: + /// + /// + /// + /// + /// Lowercase only + /// + /// + /// + /// + /// Cannot include \, /, *, ?, ", <, >, |, (space character), ,, or # /// + /// + /// + /// + /// Indices prior to 7.0 could contain a colon (:), but that has been deprecated and will not be supported in later versions + /// + /// + /// + /// + /// Cannot start with -, _, or + + /// + /// + /// + /// + /// Cannot be . or .. + /// + /// + /// + /// + /// Cannot be longer than 255 bytes (note thtat it is bytes, so multi-byte characters will reach the limit faster) + /// + /// + /// + /// + /// Names starting with . are deprecated, except for hidden indices and internal indices managed by plugins + /// + /// + /// /// public Elastic.Clients.Elasticsearch.IndexManagement.CreateIndexRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName value) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexRequest.g.cs index e3786c7503..04104f1d2c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexRequest.g.cs @@ -336,13 +336,13 @@ public IndexRequest(TDocument document, Elastic.Clients.Elasticsearch.IndexName } [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public IndexRequest(TDocument document, Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Required("index", typeof(TDocument)).Optional("id", id)) + public IndexRequest(TDocument document, Elastic.Clients.Elasticsearch.Id? id) : base(r => r.Required("index", (Elastic.Clients.Elasticsearch.IndexName)typeof(TDocument)).Optional("id", id)) { Document = document; } [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public IndexRequest(TDocument document) : base(r => r.Required("index", typeof(TDocument)).Optional("id", Elastic.Clients.Elasticsearch.Id.From(document))) + public IndexRequest(TDocument document) : base(r => r.Required("index", (Elastic.Clients.Elasticsearch.IndexName)typeof(TDocument)).Optional("id", Elastic.Clients.Elasticsearch.Id.From(document))) { Document = document; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/ChatCompletionUnifiedRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/ChatCompletionUnifiedRequest.g.cs index ed895a45ac..e8813c1777 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/ChatCompletionUnifiedRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/ChatCompletionUnifiedRequest.g.cs @@ -50,6 +50,20 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// Perform chat completion inference /// +/// +/// The chat completion inference API enables real-time responses for chat completion tasks by delivering answers incrementally, reducing response times during computation. +/// It only works with the chat_completion task type for openai and elastic inference services. +/// +/// +/// IMPORTANT: The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Azure, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face. +/// For built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models. However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs. +/// +/// +/// NOTE: The chat_completion task type is only available within the _stream API and only supports streaming. +/// The Chat completion inference API and the Stream inference API differ in their response structure and capabilities. +/// The Chat completion inference API provides more comprehensive customization options through more fields and function calling support. +/// If you use the openai service or the elastic service, use the Chat completion inference API. +/// /// [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.ChatCompletionUnifiedRequestConverter))] public sealed partial class ChatCompletionUnifiedRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest @@ -112,6 +126,20 @@ internal ChatCompletionUnifiedRequest(Elastic.Clients.Elasticsearch.Serializatio /// /// Perform chat completion inference /// +/// +/// The chat completion inference API enables real-time responses for chat completion tasks by delivering answers incrementally, reducing response times during computation. +/// It only works with the chat_completion task type for openai and elastic inference services. +/// +/// +/// IMPORTANT: The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Azure, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face. +/// For built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models. However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs. +/// +/// +/// NOTE: The chat_completion task type is only available within the _stream API and only supports streaming. +/// The Chat completion inference API and the Stream inference API differ in their response structure and capabilities. +/// The Chat completion inference API provides more comprehensive customization options through more fields and function calling support. +/// If you use the openai service or the elastic service, use the Chat completion inference API. +/// /// public readonly partial struct ChatCompletionUnifiedRequestDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudRequest.g.cs index df20259d4f..cbe78f692d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudRequest.g.cs @@ -99,13 +99,6 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// Create an inference endpoint to perform an inference task with the alibabacloud-ai-search service. /// -/// -/// When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. -/// After creating the endpoint, wait for the model deployment to complete before using it. -/// To verify the deployment status, use the get trained model statistics API. -/// Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". -/// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. -/// /// [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutAlibabacloudRequestConverter))] public sealed partial class PutAlibabacloudRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest @@ -203,13 +196,6 @@ internal PutAlibabacloudRequest(Elastic.Clients.Elasticsearch.Serialization.Json /// /// Create an inference endpoint to perform an inference task with the alibabacloud-ai-search service. /// -/// -/// When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. -/// After creating the endpoint, wait for the model deployment to complete before using it. -/// To verify the deployment status, use the get trained model statistics API. -/// Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". -/// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. -/// /// public readonly partial struct PutAlibabacloudRequestDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockRequest.g.cs index 89854e8ab9..227f5e0d8d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockRequest.g.cs @@ -103,13 +103,6 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// info /// You need to provide the access and secret keys only once, during the inference model creation. The get inference API does not retrieve your access or secret keys. After creating the inference model, you cannot change the associated key pairs. If you want to use a different access and secret key pair, delete the inference model and recreate it with the same name and the updated keys. /// -/// -/// When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. -/// After creating the endpoint, wait for the model deployment to complete before using it. -/// To verify the deployment status, use the get trained model statistics API. -/// Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". -/// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. -/// /// [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutAmazonbedrockRequestConverter))] public sealed partial class PutAmazonbedrockRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest @@ -211,13 +204,6 @@ internal PutAmazonbedrockRequest(Elastic.Clients.Elasticsearch.Serialization.Jso /// info /// You need to provide the access and secret keys only once, during the inference model creation. The get inference API does not retrieve your access or secret keys. After creating the inference model, you cannot change the associated key pairs. If you want to use a different access and secret key pair, delete the inference model and recreate it with the same name and the updated keys. /// -/// -/// When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. -/// After creating the endpoint, wait for the model deployment to complete before using it. -/// To verify the deployment status, use the get trained model statistics API. -/// Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". -/// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. -/// /// public readonly partial struct PutAmazonbedrockRequestDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAnthropicRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAnthropicRequest.g.cs index 17051a4368..54348156d4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAnthropicRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAnthropicRequest.g.cs @@ -99,13 +99,6 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// Create an inference endpoint to perform an inference task with the anthropic service. /// -/// -/// When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. -/// After creating the endpoint, wait for the model deployment to complete before using it. -/// To verify the deployment status, use the get trained model statistics API. -/// Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". -/// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. -/// /// [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutAnthropicRequestConverter))] public sealed partial class PutAnthropicRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest @@ -204,13 +197,6 @@ internal PutAnthropicRequest(Elastic.Clients.Elasticsearch.Serialization.JsonCon /// /// Create an inference endpoint to perform an inference task with the anthropic service. /// -/// -/// When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. -/// After creating the endpoint, wait for the model deployment to complete before using it. -/// To verify the deployment status, use the get trained model statistics API. -/// Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". -/// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. -/// /// public readonly partial struct PutAnthropicRequestDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureaistudioRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureaistudioRequest.g.cs index 0e88c0587d..7df1c7f251 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureaistudioRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureaistudioRequest.g.cs @@ -99,13 +99,6 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// Create an inference endpoint to perform an inference task with the azureaistudio service. /// -/// -/// When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. -/// After creating the endpoint, wait for the model deployment to complete before using it. -/// To verify the deployment status, use the get trained model statistics API. -/// Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". -/// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. -/// /// [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutAzureaistudioRequestConverter))] public sealed partial class PutAzureaistudioRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest @@ -203,13 +196,6 @@ internal PutAzureaistudioRequest(Elastic.Clients.Elasticsearch.Serialization.Jso /// /// Create an inference endpoint to perform an inference task with the azureaistudio service. /// -/// -/// When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. -/// After creating the endpoint, wait for the model deployment to complete before using it. -/// To verify the deployment status, use the get trained model statistics API. -/// Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". -/// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. -/// /// public readonly partial struct PutAzureaistudioRequestDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureopenaiRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureopenaiRequest.g.cs index 1b49344477..9e160409a2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureopenaiRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureopenaiRequest.g.cs @@ -117,13 +117,6 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// The list of embeddings models that you can choose from in your deployment can be found in the Azure models documentation. /// -/// -/// When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. -/// After creating the endpoint, wait for the model deployment to complete before using it. -/// To verify the deployment status, use the get trained model statistics API. -/// Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". -/// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. -/// /// [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutAzureopenaiRequestConverter))] public sealed partial class PutAzureopenaiRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest @@ -240,13 +233,6 @@ internal PutAzureopenaiRequest(Elastic.Clients.Elasticsearch.Serialization.JsonC /// /// The list of embeddings models that you can choose from in your deployment can be found in the Azure models documentation. /// -/// -/// When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. -/// After creating the endpoint, wait for the model deployment to complete before using it. -/// To verify the deployment status, use the get trained model statistics API. -/// Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". -/// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. -/// /// public readonly partial struct PutAzureopenaiRequestDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCohereRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCohereRequest.g.cs index 2ec6aaca32..a97b923187 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCohereRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCohereRequest.g.cs @@ -99,13 +99,6 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// Create an inference endpoint to perform an inference task with the cohere service. /// -/// -/// When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. -/// After creating the endpoint, wait for the model deployment to complete before using it. -/// To verify the deployment status, use the get trained model statistics API. -/// Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". -/// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. -/// /// [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutCohereRequestConverter))] public sealed partial class PutCohereRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest @@ -204,13 +197,6 @@ internal PutCohereRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstr /// /// Create an inference endpoint to perform an inference task with the cohere service. /// -/// -/// When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. -/// After creating the endpoint, wait for the model deployment to complete before using it. -/// To verify the deployment status, use the get trained model statistics API. -/// Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". -/// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. -/// /// public readonly partial struct PutCohereRequestDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGoogleaistudioRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGoogleaistudioRequest.g.cs index 140dab893b..e9012d60a8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGoogleaistudioRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGoogleaistudioRequest.g.cs @@ -90,13 +90,6 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// Create an inference endpoint to perform an inference task with the googleaistudio service. /// -/// -/// When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. -/// After creating the endpoint, wait for the model deployment to complete before using it. -/// To verify the deployment status, use the get trained model statistics API. -/// Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". -/// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. -/// /// [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutGoogleaistudioRequestConverter))] public sealed partial class PutGoogleaistudioRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest @@ -186,13 +179,6 @@ internal PutGoogleaistudioRequest(Elastic.Clients.Elasticsearch.Serialization.Js /// /// Create an inference endpoint to perform an inference task with the googleaistudio service. /// -/// -/// When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. -/// After creating the endpoint, wait for the model deployment to complete before using it. -/// To verify the deployment status, use the get trained model statistics API. -/// Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". -/// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. -/// /// public readonly partial struct PutGoogleaistudioRequestDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGooglevertexaiRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGooglevertexaiRequest.g.cs index 661dd54566..17d50c8b8f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGooglevertexaiRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGooglevertexaiRequest.g.cs @@ -99,13 +99,6 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// Create an inference endpoint to perform an inference task with the googlevertexai service. /// -/// -/// When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. -/// After creating the endpoint, wait for the model deployment to complete before using it. -/// To verify the deployment status, use the get trained model statistics API. -/// Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". -/// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. -/// /// [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutGooglevertexaiRequestConverter))] public sealed partial class PutGooglevertexaiRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest @@ -203,13 +196,6 @@ internal PutGooglevertexaiRequest(Elastic.Clients.Elasticsearch.Serialization.Js /// /// Create an inference endpoint to perform an inference task with the googlevertexai service. /// -/// -/// When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. -/// After creating the endpoint, wait for the model deployment to complete before using it. -/// To verify the deployment status, use the get trained model statistics API. -/// Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". -/// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. -/// /// public readonly partial struct PutGooglevertexaiRequestDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutHuggingFaceRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutHuggingFaceRequest.g.cs index add5d04ea5..5fd154eb21 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutHuggingFaceRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutHuggingFaceRequest.g.cs @@ -135,13 +135,6 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// /// -/// -/// When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. -/// After creating the endpoint, wait for the model deployment to complete before using it. -/// To verify the deployment status, use the get trained model statistics API. -/// Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". -/// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. -/// /// [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutHuggingFaceRequestConverter))] public sealed partial class PutHuggingFaceRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest @@ -276,13 +269,6 @@ internal PutHuggingFaceRequest(Elastic.Clients.Elasticsearch.Serialization.JsonC /// /// /// -/// -/// When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. -/// After creating the endpoint, wait for the model deployment to complete before using it. -/// To verify the deployment status, use the get trained model statistics API. -/// Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". -/// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. -/// /// public readonly partial struct PutHuggingFaceRequestDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceRequest.g.cs index 6edf4da1ab..d9cff4d822 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceRequest.g.cs @@ -43,11 +43,6 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// /// Create an inference endpoint. -/// When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. -/// After creating the endpoint, wait for the model deployment to complete before using it. -/// To verify the deployment status, use the get trained model statistics API. -/// Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". -/// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. /// /// /// IMPORTANT: The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Mistral, Azure OpenAI, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face. @@ -127,11 +122,6 @@ internal PutInferenceRequest(Elastic.Clients.Elasticsearch.Serialization.JsonCon /// /// /// Create an inference endpoint. -/// When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. -/// After creating the endpoint, wait for the model deployment to complete before using it. -/// To verify the deployment status, use the get trained model statistics API. -/// Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". -/// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. /// /// /// IMPORTANT: The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Mistral, Azure OpenAI, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiRequest.g.cs index 2ff13758ab..a4aac4e6de 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiRequest.g.cs @@ -103,13 +103,6 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// To review the available rerank models, refer to https://jina.ai/reranker. /// To review the available text_embedding models, refer to the https://jina.ai/embeddings/. /// -/// -/// When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. -/// After creating the endpoint, wait for the model deployment to complete before using it. -/// To verify the deployment status, use the get trained model statistics API. -/// Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". -/// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. -/// /// [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutJinaaiRequestConverter))] public sealed partial class PutJinaaiRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest @@ -211,13 +204,6 @@ internal PutJinaaiRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstr /// To review the available rerank models, refer to https://jina.ai/reranker. /// To review the available text_embedding models, refer to the https://jina.ai/embeddings/. /// -/// -/// When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. -/// After creating the endpoint, wait for the model deployment to complete before using it. -/// To verify the deployment status, use the get trained model statistics API. -/// Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". -/// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. -/// /// public readonly partial struct PutJinaaiRequestDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutMistralRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutMistralRequest.g.cs index bc36345d25..34adeb0236 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutMistralRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutMistralRequest.g.cs @@ -90,13 +90,6 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// /// Creates an inference endpoint to perform an inference task with the mistral service. /// -/// -/// When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. -/// After creating the endpoint, wait for the model deployment to complete before using it. -/// To verify the deployment status, use the get trained model statistics API. -/// Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". -/// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. -/// /// [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutMistralRequestConverter))] public sealed partial class PutMistralRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest @@ -187,13 +180,6 @@ internal PutMistralRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// /// Creates an inference endpoint to perform an inference task with the mistral service. /// -/// -/// When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. -/// After creating the endpoint, wait for the model deployment to complete before using it. -/// To verify the deployment status, use the get trained model statistics API. -/// Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". -/// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. -/// /// public readonly partial struct PutMistralRequestDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenaiRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenaiRequest.g.cs index cf1af4bb0a..9bccde1400 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenaiRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenaiRequest.g.cs @@ -97,14 +97,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// Create an OpenAI inference endpoint. /// /// -/// Create an inference endpoint to perform an inference task with the openai service. -/// -/// -/// When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. -/// After creating the endpoint, wait for the model deployment to complete before using it. -/// To verify the deployment status, use the get trained model statistics API. -/// Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". -/// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. +/// Create an inference endpoint to perform an inference task with the openai service or openai compatible APIs. /// /// [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutOpenaiRequestConverter))] @@ -202,14 +195,7 @@ internal PutOpenaiRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstr /// Create an OpenAI inference endpoint. /// /// -/// Create an inference endpoint to perform an inference task with the openai service. -/// -/// -/// When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. -/// After creating the endpoint, wait for the model deployment to complete before using it. -/// To verify the deployment status, use the get trained model statistics API. -/// Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". -/// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. +/// Create an inference endpoint to perform an inference task with the openai service or openai compatible APIs. /// /// public readonly partial struct PutOpenaiRequestDescriptor diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxRequest.g.cs index 92b3f8cee1..38fd9db931 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxRequest.g.cs @@ -83,13 +83,6 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien /// You need an IBM Cloud Databases for Elasticsearch deployment to use the watsonxai inference service. /// You can provision one through the IBM catalog, the Cloud Databases CLI plug-in, the Cloud Databases API, or Terraform. /// -/// -/// When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. -/// After creating the endpoint, wait for the model deployment to complete before using it. -/// To verify the deployment status, use the get trained model statistics API. -/// Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". -/// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. -/// /// [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.PutWatsonxRequestConverter))] public sealed partial class PutWatsonxRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest @@ -175,13 +168,6 @@ internal PutWatsonxRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// You need an IBM Cloud Databases for Elasticsearch deployment to use the watsonxai inference service. /// You can provision one through the IBM catalog, the Cloud Databases CLI plug-in, the Cloud Databases API, or Terraform. /// -/// -/// When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. -/// After creating the endpoint, wait for the model deployment to complete before using it. -/// To verify the deployment status, use the get trained model statistics API. -/// Look for "state": "fully_allocated" in the response and ensure that the "allocation_count" matches the "target_allocation_count". -/// Avoid creating multiple endpoints for the same model unless required, as each endpoint consumes significant resources. -/// /// public readonly partial struct PutWatsonxRequestDescriptor { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs index 0a17899fd6..29c824eb9f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs @@ -178,7 +178,15 @@ public sealed partial class SearchRequestParameters : Elastic.Transport.RequestP /// /// /// _prefer_nodes:<node-id>,<node-id> to if possible, run the search on the specified nodes IDs. If not, select shards using the default method. + /// + /// + /// + /// /// _shards:<shard>,<shard> to run the search only on the specified shards. You can combine this value with other preference values. However, the _shards value must come first. For example: _shards:2,3|_local. + /// + /// + /// + /// /// <custom-string> (any string that does not start with _) to route searches with the same <custom-string> to the same shards in the same order. /// /// @@ -879,7 +887,15 @@ internal SearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstruct /// /// /// _prefer_nodes:<node-id>,<node-id> to if possible, run the search on the specified nodes IDs. If not, select shards using the default method. + /// + /// + /// + /// /// _shards:<shard>,<shard> to run the search only on the specified shards. You can combine this value with other preference values. However, the _shards value must come first. For example: _shards:2,3|_local. + /// + /// + /// + /// /// <custom-string> (any string that does not start with _) to route searches with the same <custom-string> to the same shards in the same order. /// /// @@ -1590,7 +1606,15 @@ public Elastic.Clients.Elasticsearch.SearchRequestDescriptor MaxConcurrentShardR /// /// /// _prefer_nodes:<node-id>,<node-id> to if possible, run the search on the specified nodes IDs. If not, select shards using the default method. + /// + /// + /// + /// /// _shards:<shard>,<shard> to run the search only on the specified shards. You can combine this value with other preference values. However, the _shards value must come first. For example: _shards:2,3|_local. + /// + /// + /// + /// /// <custom-string> (any string that does not start with _) to route searches with the same <custom-string> to the same shards in the same order. /// /// @@ -3326,7 +3350,15 @@ public Elastic.Clients.Elasticsearch.SearchRequestDescriptor MaxConcu /// /// /// _prefer_nodes:<node-id>,<node-id> to if possible, run the search on the specified nodes IDs. If not, select shards using the default method. + /// + /// + /// + /// /// _shards:<shard>,<shard> to run the search only on the specified shards. You can combine this value with other preference values. However, the _shards value must come first. For example: _shards:2,3|_local. + /// + /// + /// + /// /// <custom-string> (any string that does not start with _) to route searches with the same <custom-string> to the same shards in the same order. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ApostropheTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ApostropheTokenFilter.g.cs new file mode 100644 index 0000000000..138264a839 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ApostropheTokenFilter.g.cs @@ -0,0 +1,134 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +internal sealed partial class ApostropheTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilterConverter))] +public sealed partial class ApostropheTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter +{ +#if NET7_0_OR_GREATER + public ApostropheTokenFilter() + { + } +#endif +#if !NET7_0_OR_GREATER + public ApostropheTokenFilter() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal ApostropheTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public string Type => "apostrophe"; + + public string? Version { get; set; } +} + +public readonly partial struct ApostropheTokenFilterDescriptor +{ + internal Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilter Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ApostropheTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilter instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ApostropheTokenFilterDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilterDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilter(Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilterDescriptor descriptor) => descriptor.Instance; + + public Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilterDescriptor Version(string? value) + { + Instance.Version = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilter Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilterDescriptor(new Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicAnalyzer.g.cs index 31667cb650..fd06a888fc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.ArabicAnalyzer Read(ref S { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.ArabicAnalyzer Read(ref S continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal ArabicAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstruc } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "arabic"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.ArabicAnalyzerDescriptor StemExclu return this; } - public Elastic.Clients.Elasticsearch.Analysis.ArabicAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.ArabicAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.ArabicAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.ArabicAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicNormalizationTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicNormalizationTokenFilter.g.cs new file mode 100644 index 0000000000..1c9ca2562e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArabicNormalizationTokenFilter.g.cs @@ -0,0 +1,134 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +internal sealed partial class ArabicNormalizationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilterConverter))] +public sealed partial class ArabicNormalizationTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter +{ +#if NET7_0_OR_GREATER + public ArabicNormalizationTokenFilter() + { + } +#endif +#if !NET7_0_OR_GREATER + public ArabicNormalizationTokenFilter() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal ArabicNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public string Type => "arabic_normalization"; + + public string? Version { get; set; } +} + +public readonly partial struct ArabicNormalizationTokenFilterDescriptor +{ + internal Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilter Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ArabicNormalizationTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilter instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ArabicNormalizationTokenFilterDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilterDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilterDescriptor descriptor) => descriptor.Instance; + + public Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilterDescriptor Version(string? value) + { + Instance.Version = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilter Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilterDescriptor(new Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArmenianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArmenianAnalyzer.g.cs index c92bf3c638..b615506beb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArmenianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ArmenianAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.ArmenianAnalyzer Read(ref { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.ArmenianAnalyzer Read(ref continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal ArmenianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstr } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "armenian"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.ArmenianAnalyzerDescriptor StemExc return this; } - public Elastic.Clients.Elasticsearch.Analysis.ArmenianAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.ArmenianAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.ArmenianAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.ArmenianAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/AsciiFoldingTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/AsciiFoldingTokenFilter.g.cs index c9c691cd4e..4104660af7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/AsciiFoldingTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/AsciiFoldingTokenFilter.g.cs @@ -98,6 +98,11 @@ internal AsciiFoldingTokenFilter(Elastic.Clients.Elasticsearch.Serialization.Jso _ = sentinel; } + /// + /// + /// If true, emit both original tokens and folded tokens. Defaults to false. + /// + /// public bool? PreserveOriginal { get; set; } public string Type => "asciifolding"; @@ -124,6 +129,11 @@ public AsciiFoldingTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.AsciiFoldingTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.AsciiFoldingTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.AsciiFoldingTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.AsciiFoldingTokenFilter(Elastic.Clients.Elasticsearch.Analysis.AsciiFoldingTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// If true, emit both original tokens and folded tokens. Defaults to false. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.AsciiFoldingTokenFilterDescriptor PreserveOriginal(bool? value = true) { Instance.PreserveOriginal = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BasqueAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BasqueAnalyzer.g.cs index d3b5ff166d..c32c8bfc3b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BasqueAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BasqueAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.BasqueAnalyzer Read(ref S { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.BasqueAnalyzer Read(ref S continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal BasqueAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstruc } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "basque"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.BasqueAnalyzerDescriptor StemExclu return this; } - public Elastic.Clients.Elasticsearch.Analysis.BasqueAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.BasqueAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.BasqueAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.BasqueAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BengaliAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BengaliAnalyzer.g.cs index 82da3aa433..b564cc4e3c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BengaliAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BengaliAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.BengaliAnalyzer Read(ref { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.BengaliAnalyzer Read(ref continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal BengaliAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstru } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "bengali"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.BengaliAnalyzerDescriptor StemExcl return this; } - public Elastic.Clients.Elasticsearch.Analysis.BengaliAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.BengaliAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.BengaliAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.BengaliAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BrazilianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BrazilianAnalyzer.g.cs index 2a1c278a40..ed9a7760e4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BrazilianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BrazilianAnalyzer.g.cs @@ -32,11 +32,11 @@ internal sealed partial class BrazilianAnalyzerConverter : System.Text.Json.Seri public override Elastic.Clients.Elasticsearch.Analysis.BrazilianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -72,7 +72,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.BrazilianAnalyzer Read(re public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.BrazilianAnalyzer value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -98,7 +98,7 @@ internal BrazilianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConst _ = sentinel; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "brazilian"; @@ -123,18 +123,12 @@ public BrazilianAnalyzerDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.BrazilianAnalyzerDescriptor(Elastic.Clients.Elasticsearch.Analysis.BrazilianAnalyzer instance) => new Elastic.Clients.Elasticsearch.Analysis.BrazilianAnalyzerDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.BrazilianAnalyzer(Elastic.Clients.Elasticsearch.Analysis.BrazilianAnalyzerDescriptor descriptor) => descriptor.Instance; - public Elastic.Clients.Elasticsearch.Analysis.BrazilianAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.BrazilianAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.BrazilianAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.BrazilianAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BulgarianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BulgarianAnalyzer.g.cs index 2a68aea1e0..8586c7670a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BulgarianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/BulgarianAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.BulgarianAnalyzer Read(re { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.BulgarianAnalyzer Read(re continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal BulgarianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConst } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "bulgarian"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.BulgarianAnalyzerDescriptor StemEx return this; } - public Elastic.Clients.Elasticsearch.Analysis.BulgarianAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.BulgarianAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.BulgarianAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.BulgarianAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CatalanAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CatalanAnalyzer.g.cs index 40e61b61e9..570381d736 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CatalanAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CatalanAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.CatalanAnalyzer Read(ref { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.CatalanAnalyzer Read(ref continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal CatalanAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstru } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "catalan"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.CatalanAnalyzerDescriptor StemExcl return this; } - public Elastic.Clients.Elasticsearch.Analysis.CatalanAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.CatalanAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.CatalanAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.CatalanAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ChineseAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ChineseAnalyzer.g.cs index e250960c78..099ece3579 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ChineseAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ChineseAnalyzer.g.cs @@ -32,11 +32,11 @@ internal sealed partial class ChineseAnalyzerConverter : System.Text.Json.Serial public override Elastic.Clients.Elasticsearch.Analysis.ChineseAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -72,7 +72,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.ChineseAnalyzer Read(ref public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ChineseAnalyzer value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -98,7 +98,7 @@ internal ChineseAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstru _ = sentinel; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "chinese"; @@ -123,18 +123,12 @@ public ChineseAnalyzerDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.ChineseAnalyzerDescriptor(Elastic.Clients.Elasticsearch.Analysis.ChineseAnalyzer instance) => new Elastic.Clients.Elasticsearch.Analysis.ChineseAnalyzerDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.ChineseAnalyzer(Elastic.Clients.Elasticsearch.Analysis.ChineseAnalyzerDescriptor descriptor) => descriptor.Instance; - public Elastic.Clients.Elasticsearch.Analysis.ChineseAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.ChineseAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.ChineseAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.ChineseAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkAnalyzer.g.cs index ff34f87b8f..75cda96ddf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkAnalyzer.g.cs @@ -32,11 +32,11 @@ internal sealed partial class CjkAnalyzerConverter : System.Text.Json.Serializat public override Elastic.Clients.Elasticsearch.Analysis.CjkAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -72,7 +72,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.CjkAnalyzer Read(ref Syst public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CjkAnalyzer value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -98,7 +98,7 @@ internal CjkAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructor _ = sentinel; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "cjk"; @@ -123,18 +123,12 @@ public CjkAnalyzerDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.CjkAnalyzerDescriptor(Elastic.Clients.Elasticsearch.Analysis.CjkAnalyzer instance) => new Elastic.Clients.Elasticsearch.Analysis.CjkAnalyzerDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.CjkAnalyzer(Elastic.Clients.Elasticsearch.Analysis.CjkAnalyzerDescriptor descriptor) => descriptor.Instance; - public Elastic.Clients.Elasticsearch.Analysis.CjkAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.CjkAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.CjkAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.CjkAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkBigramTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkBigramTokenFilter.g.cs new file mode 100644 index 0000000000..b7d828d7e5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkBigramTokenFilter.g.cs @@ -0,0 +1,199 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +internal sealed partial class CjkBigramTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIgnoredScripts = System.Text.Json.JsonEncodedText.Encode("ignored_scripts"); + private static readonly System.Text.Json.JsonEncodedText PropOutputUnigrams = System.Text.Json.JsonEncodedText.Encode("output_unigrams"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propIgnoredScripts = default; + LocalJsonValue propOutputUnigrams = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIgnoredScripts.TryReadProperty(ref reader, options, PropIgnoredScripts, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propOutputUnigrams.TryReadProperty(ref reader, options, PropOutputUnigrams, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + IgnoredScripts = propIgnoredScripts.Value, + OutputUnigrams = propOutputUnigrams.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIgnoredScripts, value.IgnoredScripts, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropOutputUnigrams, value.OutputUnigrams, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilterConverter))] +public sealed partial class CjkBigramTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter +{ +#if NET7_0_OR_GREATER + public CjkBigramTokenFilter() + { + } +#endif +#if !NET7_0_OR_GREATER + public CjkBigramTokenFilter() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal CjkBigramTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// Array of character scripts for which to disable bigrams. + /// + /// + public System.Collections.Generic.ICollection? IgnoredScripts { get; set; } + + /// + /// + /// If true, emit tokens in both bigram and unigram form. If false, a CJK character is output in unigram form when it has no adjacent characters. Defaults to false. + /// + /// + public bool? OutputUnigrams { get; set; } + + public string Type => "cjk_bigram"; + + public string? Version { get; set; } +} + +public readonly partial struct CjkBigramTokenFilterDescriptor +{ + internal Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilter Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CjkBigramTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilter instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CjkBigramTokenFilterDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilterDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilter(Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilterDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// Array of character scripts for which to disable bigrams. + /// + /// + public Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilterDescriptor IgnoredScripts(System.Collections.Generic.ICollection? value) + { + Instance.IgnoredScripts = value; + return this; + } + + /// + /// + /// Array of character scripts for which to disable bigrams. + /// + /// + public Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilterDescriptor IgnoredScripts(params Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript[] values) + { + Instance.IgnoredScripts = [.. values]; + return this; + } + + /// + /// + /// If true, emit tokens in both bigram and unigram form. If false, a CJK character is output in unigram form when it has no adjacent characters. Defaults to false. + /// + /// + public Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilterDescriptor OutputUnigrams(bool? value = true) + { + Instance.OutputUnigrams = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilterDescriptor Version(string? value) + { + Instance.Version = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilter Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilterDescriptor(new Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkWidthTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkWidthTokenFilter.g.cs new file mode 100644 index 0000000000..a19848c4ab --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CjkWidthTokenFilter.g.cs @@ -0,0 +1,134 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +internal sealed partial class CjkWidthTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilterConverter))] +public sealed partial class CjkWidthTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter +{ +#if NET7_0_OR_GREATER + public CjkWidthTokenFilter() + { + } +#endif +#if !NET7_0_OR_GREATER + public CjkWidthTokenFilter() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal CjkWidthTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public string Type => "cjk_width"; + + public string? Version { get; set; } +} + +public readonly partial struct CjkWidthTokenFilterDescriptor +{ + internal Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilter Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CjkWidthTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilter instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CjkWidthTokenFilterDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilterDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilter(Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilterDescriptor descriptor) => descriptor.Instance; + + public Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilterDescriptor Version(string? value) + { + Instance.Version = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilter Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilterDescriptor(new Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ClassicTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ClassicTokenFilter.g.cs new file mode 100644 index 0000000000..04cc94440a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ClassicTokenFilter.g.cs @@ -0,0 +1,134 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +internal sealed partial class ClassicTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilterConverter))] +public sealed partial class ClassicTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter +{ +#if NET7_0_OR_GREATER + public ClassicTokenFilter() + { + } +#endif +#if !NET7_0_OR_GREATER + public ClassicTokenFilter() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal ClassicTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public string Type => "classic"; + + public string? Version { get; set; } +} + +public readonly partial struct ClassicTokenFilterDescriptor +{ + internal Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilter Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ClassicTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilter instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ClassicTokenFilterDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilterDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilter(Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilterDescriptor descriptor) => descriptor.Instance; + + public Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilterDescriptor Version(string? value) + { + Instance.Version = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilter Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilterDescriptor(new Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CommonGramsTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CommonGramsTokenFilter.g.cs index 4f3573feb4..60ce0f99e5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CommonGramsTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CommonGramsTokenFilter.g.cs @@ -125,9 +125,48 @@ internal CommonGramsTokenFilter(Elastic.Clients.Elasticsearch.Serialization.Json _ = sentinel; } + /// + /// + /// A list of tokens. The filter generates bigrams for these tokens. + /// Either this or the common_words_path parameter is required. + /// + /// public System.Collections.Generic.ICollection? CommonWords { get; set; } + + /// + /// + /// Path to a file containing a list of tokens. The filter generates bigrams for these tokens. + /// This path must be absolute or relative to the config location. The file must be UTF-8 encoded. Each token in the file must be separated by a line break. + /// Either this or the common_words parameter is required. + /// + /// public string? CommonWordsPath { get; set; } + + /// + /// + /// If true, matches for common words matching are case-insensitive. Defaults to false. + /// + /// public bool? IgnoreCase { get; set; } + + /// + /// + /// If true, the filter excludes the following tokens from the output: + /// + /// + /// + /// + /// Unigrams for common words + /// + /// + /// + /// + /// Unigrams for terms followed by common words + /// Defaults to false. We recommend enabling this parameter for search analyzers. + /// + /// + /// + /// public bool? QueryMode { get; set; } public string Type => "common_grams"; @@ -154,30 +193,72 @@ public CommonGramsTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.CommonGramsTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.CommonGramsTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.CommonGramsTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.CommonGramsTokenFilter(Elastic.Clients.Elasticsearch.Analysis.CommonGramsTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// A list of tokens. The filter generates bigrams for these tokens. + /// Either this or the common_words_path parameter is required. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.CommonGramsTokenFilterDescriptor CommonWords(System.Collections.Generic.ICollection? value) { Instance.CommonWords = value; return this; } + /// + /// + /// A list of tokens. The filter generates bigrams for these tokens. + /// Either this or the common_words_path parameter is required. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.CommonGramsTokenFilterDescriptor CommonWords(params string[] values) { Instance.CommonWords = [.. values]; return this; } + /// + /// + /// Path to a file containing a list of tokens. The filter generates bigrams for these tokens. + /// This path must be absolute or relative to the config location. The file must be UTF-8 encoded. Each token in the file must be separated by a line break. + /// Either this or the common_words parameter is required. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.CommonGramsTokenFilterDescriptor CommonWordsPath(string? value) { Instance.CommonWordsPath = value; return this; } + /// + /// + /// If true, matches for common words matching are case-insensitive. Defaults to false. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.CommonGramsTokenFilterDescriptor IgnoreCase(bool? value = true) { Instance.IgnoreCase = value; return this; } + /// + /// + /// If true, the filter excludes the following tokens from the output: + /// + /// + /// + /// + /// Unigrams for common words + /// + /// + /// + /// + /// Unigrams for terms followed by common words + /// Defaults to false. We recommend enabling this parameter for search analyzers. + /// + /// + /// + /// public Elastic.Clients.Elasticsearch.Analysis.CommonGramsTokenFilterDescriptor QueryMode(bool? value = true) { Instance.QueryMode = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ConditionTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ConditionTokenFilter.g.cs index 10bb963a3d..0c1b8cd96e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ConditionTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ConditionTokenFilter.g.cs @@ -114,11 +114,22 @@ internal ConditionTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonCo _ = sentinel; } + /// + /// + /// Array of token filters. If a token matches the predicate script in the script parameter, these filters are applied to the token in the order provided. + /// + /// public #if NET7_0_OR_GREATER required #endif System.Collections.Generic.ICollection Filter { get; set; } + + /// + /// + /// Predicate script used to apply token filters. If a token matches this script, the filters in the filter parameter are applied to the token. + /// + /// public #if NET7_0_OR_GREATER required @@ -149,30 +160,55 @@ public ConditionTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.ConditionTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.ConditionTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.ConditionTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.ConditionTokenFilter(Elastic.Clients.Elasticsearch.Analysis.ConditionTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// Array of token filters. If a token matches the predicate script in the script parameter, these filters are applied to the token in the order provided. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.ConditionTokenFilterDescriptor Filter(System.Collections.Generic.ICollection value) { Instance.Filter = value; return this; } + /// + /// + /// Array of token filters. If a token matches the predicate script in the script parameter, these filters are applied to the token in the order provided. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.ConditionTokenFilterDescriptor Filter(params string[] values) { Instance.Filter = [.. values]; return this; } + /// + /// + /// Predicate script used to apply token filters. If a token matches this script, the filters in the filter parameter are applied to the token. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.ConditionTokenFilterDescriptor Script(Elastic.Clients.Elasticsearch.Script value) { Instance.Script = value; return this; } + /// + /// + /// Predicate script used to apply token filters. If a token matches this script, the filters in the filter parameter are applied to the token. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.ConditionTokenFilterDescriptor Script() { Instance.Script = Elastic.Clients.Elasticsearch.ScriptDescriptor.Build(null); return this; } + /// + /// + /// Predicate script used to apply token filters. If a token matches this script, the filters in the filter parameter are applied to the token. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.ConditionTokenFilterDescriptor Script(System.Action? action) { Instance.Script = Elastic.Clients.Elasticsearch.ScriptDescriptor.Build(action); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CzechAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CzechAnalyzer.g.cs index f37029f4c4..716a20a2d5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CzechAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/CzechAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.CzechAnalyzer Read(ref Sy { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.CzechAnalyzer Read(ref Sy continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal CzechAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstruct } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "czech"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.CzechAnalyzerDescriptor StemExclus return this; } - public Elastic.Clients.Elasticsearch.Analysis.CzechAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.CzechAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.CzechAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.CzechAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DanishAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DanishAnalyzer.g.cs index 43243e1484..e90faefe6a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DanishAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DanishAnalyzer.g.cs @@ -32,11 +32,11 @@ internal sealed partial class DanishAnalyzerConverter : System.Text.Json.Seriali public override Elastic.Clients.Elasticsearch.Analysis.DanishAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -72,7 +72,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.DanishAnalyzer Read(ref S public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.DanishAnalyzer value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -98,7 +98,7 @@ internal DanishAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstruc _ = sentinel; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "danish"; @@ -123,18 +123,12 @@ public DanishAnalyzerDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.DanishAnalyzerDescriptor(Elastic.Clients.Elasticsearch.Analysis.DanishAnalyzer instance) => new Elastic.Clients.Elasticsearch.Analysis.DanishAnalyzerDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.DanishAnalyzer(Elastic.Clients.Elasticsearch.Analysis.DanishAnalyzerDescriptor descriptor) => descriptor.Instance; - public Elastic.Clients.Elasticsearch.Analysis.DanishAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.DanishAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.DanishAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.DanishAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DecimalDigitTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DecimalDigitTokenFilter.g.cs new file mode 100644 index 0000000000..9215467d75 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DecimalDigitTokenFilter.g.cs @@ -0,0 +1,134 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +internal sealed partial class DecimalDigitTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilterConverter))] +public sealed partial class DecimalDigitTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter +{ +#if NET7_0_OR_GREATER + public DecimalDigitTokenFilter() + { + } +#endif +#if !NET7_0_OR_GREATER + public DecimalDigitTokenFilter() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal DecimalDigitTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public string Type => "decimal_digit"; + + public string? Version { get; set; } +} + +public readonly partial struct DecimalDigitTokenFilterDescriptor +{ + internal Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilter Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public DecimalDigitTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilter instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public DecimalDigitTokenFilterDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilterDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilter(Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilterDescriptor descriptor) => descriptor.Instance; + + public Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilterDescriptor Version(string? value) + { + Instance.Version = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilter Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilterDescriptor(new Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DelimitedPayloadTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DelimitedPayloadTokenFilter.g.cs index ea2c847921..95f3c8ac0c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DelimitedPayloadTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DelimitedPayloadTokenFilter.g.cs @@ -107,7 +107,18 @@ internal DelimitedPayloadTokenFilter(Elastic.Clients.Elasticsearch.Serialization _ = sentinel; } + /// + /// + /// Character used to separate tokens from payloads. Defaults to |. + /// + /// public string? Delimiter { get; set; } + + /// + /// + /// Data type for the stored payload. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding? Encoding { get; set; } public string Type => "delimited_payload"; @@ -134,12 +145,22 @@ public DelimitedPayloadTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadTokenFilter(Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// Character used to separate tokens from payloads. Defaults to |. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadTokenFilterDescriptor Delimiter(string? value) { Instance.Delimiter = value; return this; } + /// + /// + /// Data type for the stored payload. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadTokenFilterDescriptor Encoding(Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadEncoding? value) { Instance.Encoding = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DictionaryDecompounderTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DictionaryDecompounderTokenFilter.g.cs index 59df54ef3a..9f925f0a19 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DictionaryDecompounderTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DictionaryDecompounderTokenFilter.g.cs @@ -25,7 +25,6 @@ namespace Elastic.Clients.Elasticsearch.Analysis; internal sealed partial class DictionaryDecompounderTokenFilterConverter : System.Text.Json.Serialization.JsonConverter { - private static readonly System.Text.Json.JsonEncodedText PropHyphenationPatternsPath = System.Text.Json.JsonEncodedText.Encode("hyphenation_patterns_path"); private static readonly System.Text.Json.JsonEncodedText PropMaxSubwordSize = System.Text.Json.JsonEncodedText.Encode("max_subword_size"); private static readonly System.Text.Json.JsonEncodedText PropMinSubwordSize = System.Text.Json.JsonEncodedText.Encode("min_subword_size"); private static readonly System.Text.Json.JsonEncodedText PropMinWordSize = System.Text.Json.JsonEncodedText.Encode("min_word_size"); @@ -38,7 +37,6 @@ internal sealed partial class DictionaryDecompounderTokenFilterConverter : Syste public override Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propHyphenationPatternsPath = default; LocalJsonValue propMaxSubwordSize = default; LocalJsonValue propMinSubwordSize = default; LocalJsonValue propMinWordSize = default; @@ -48,11 +46,6 @@ public override Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTok LocalJsonValue propWordListPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { - if (propHyphenationPatternsPath.TryReadProperty(ref reader, options, PropHyphenationPatternsPath, null)) - { - continue; - } - if (propMaxSubwordSize.TryReadProperty(ref reader, options, PropMaxSubwordSize, null)) { continue; @@ -106,7 +99,6 @@ public override Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTok reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); return new Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { - HyphenationPatternsPath = propHyphenationPatternsPath.Value, MaxSubwordSize = propMaxSubwordSize.Value, MinSubwordSize = propMinSubwordSize.Value, MinWordSize = propMinWordSize.Value, @@ -120,7 +112,6 @@ public override Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTok public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTokenFilter value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); - writer.WriteProperty(options, PropHyphenationPatternsPath, value.HyphenationPatternsPath, null, null); writer.WriteProperty(options, PropMaxSubwordSize, value.MaxSubwordSize, null, null); writer.WriteProperty(options, PropMinSubwordSize, value.MinSubwordSize, null, null); writer.WriteProperty(options, PropMinWordSize, value.MinWordSize, null, null); @@ -152,16 +143,53 @@ internal DictionaryDecompounderTokenFilter(Elastic.Clients.Elasticsearch.Seriali _ = sentinel; } - public string? HyphenationPatternsPath { get; set; } + /// + /// + /// Maximum subword character length. Longer subword tokens are excluded from the output. Defaults to 15. + /// + /// public int? MaxSubwordSize { get; set; } + + /// + /// + /// Minimum subword character length. Shorter subword tokens are excluded from the output. Defaults to 2. + /// + /// public int? MinSubwordSize { get; set; } + + /// + /// + /// Minimum word character length. Shorter word tokens are excluded from the output. Defaults to 5. + /// + /// public int? MinWordSize { get; set; } + + /// + /// + /// If true, only include the longest matching subword. Defaults to false. + /// + /// public bool? OnlyLongestMatch { get; set; } public string Type => "dictionary_decompounder"; public string? Version { get; set; } + + /// + /// + /// A list of subwords to look for in the token stream. If found, the subword is included in the token output. + /// Either this parameter or word_list_path must be specified. + /// + /// public System.Collections.Generic.ICollection? WordList { get; set; } + + /// + /// + /// Path to a file that contains a list of subwords to find in the token stream. If found, the subword is included in the token output. + /// This path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each token in the file must be separated by a line break. + /// Either this parameter or word_list must be specified. + /// + /// public string? WordListPath { get; set; } } @@ -184,30 +212,44 @@ public DictionaryDecompounderTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTokenFilter(Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTokenFilterDescriptor descriptor) => descriptor.Instance; - public Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTokenFilterDescriptor HyphenationPatternsPath(string? value) - { - Instance.HyphenationPatternsPath = value; - return this; - } - + /// + /// + /// Maximum subword character length. Longer subword tokens are excluded from the output. Defaults to 15. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTokenFilterDescriptor MaxSubwordSize(int? value) { Instance.MaxSubwordSize = value; return this; } + /// + /// + /// Minimum subword character length. Shorter subword tokens are excluded from the output. Defaults to 2. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTokenFilterDescriptor MinSubwordSize(int? value) { Instance.MinSubwordSize = value; return this; } + /// + /// + /// Minimum word character length. Shorter word tokens are excluded from the output. Defaults to 5. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTokenFilterDescriptor MinWordSize(int? value) { Instance.MinWordSize = value; return this; } + /// + /// + /// If true, only include the longest matching subword. Defaults to false. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTokenFilterDescriptor OnlyLongestMatch(bool? value = true) { Instance.OnlyLongestMatch = value; @@ -220,18 +262,37 @@ public Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTokenFilterD return this; } + /// + /// + /// A list of subwords to look for in the token stream. If found, the subword is included in the token output. + /// Either this parameter or word_list_path must be specified. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTokenFilterDescriptor WordList(System.Collections.Generic.ICollection? value) { Instance.WordList = value; return this; } + /// + /// + /// A list of subwords to look for in the token stream. If found, the subword is included in the token output. + /// Either this parameter or word_list_path must be specified. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTokenFilterDescriptor WordList(params string[] values) { Instance.WordList = [.. values]; return this; } + /// + /// + /// Path to a file that contains a list of subwords to find in the token stream. If found, the subword is included in the token output. + /// This path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each token in the file must be separated by a line break. + /// Either this parameter or word_list must be specified. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.DictionaryDecompounderTokenFilterDescriptor WordListPath(string? value) { Instance.WordListPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DutchAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DutchAnalyzer.g.cs index fbc02381d8..60a66c863e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DutchAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/DutchAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.DutchAnalyzer Read(ref Sy { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.DutchAnalyzer Read(ref Sy continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal DutchAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstruct } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "dutch"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.DutchAnalyzerDescriptor StemExclus return this; } - public Elastic.Clients.Elasticsearch.Analysis.DutchAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.DutchAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.DutchAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.DutchAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenFilter.g.cs index a3bc3ffc7d..a5f8178063 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EdgeNGramTokenFilter.g.cs @@ -125,9 +125,32 @@ internal EdgeNGramTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonCo _ = sentinel; } + /// + /// + /// Maximum character length of a gram. For custom token filters, defaults to 2. For the built-in edge_ngram filter, defaults to 1. + /// + /// public int? MaxGram { get; set; } + + /// + /// + /// Minimum character length of a gram. Defaults to 1. + /// + /// public int? MinGram { get; set; } + + /// + /// + /// Emits original token when set to true. Defaults to false. + /// + /// public bool? PreserveOriginal { get; set; } + + /// + /// + /// Indicates whether to truncate tokens from the front or back. Defaults to front. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide? Side { get; set; } public string Type => "edge_ngram"; @@ -154,24 +177,44 @@ public EdgeNGramTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenFilter(Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// Maximum character length of a gram. For custom token filters, defaults to 2. For the built-in edge_ngram filter, defaults to 1. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenFilterDescriptor MaxGram(int? value) { Instance.MaxGram = value; return this; } + /// + /// + /// Minimum character length of a gram. Defaults to 1. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenFilterDescriptor MinGram(int? value) { Instance.MinGram = value; return this; } + /// + /// + /// Emits original token when set to true. Defaults to false. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenFilterDescriptor PreserveOriginal(bool? value = true) { Instance.PreserveOriginal = value; return this; } + /// + /// + /// Indicates whether to truncate tokens from the front or back. Defaults to front. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.EdgeNGramTokenFilterDescriptor Side(Elastic.Clients.Elasticsearch.Analysis.EdgeNGramSide? value) { Instance.Side = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ElisionTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ElisionTokenFilter.g.cs index 3d186d38f5..6ec88f8f68 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ElisionTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ElisionTokenFilter.g.cs @@ -116,8 +116,30 @@ internal ElisionTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonCons _ = sentinel; } + /// + /// + /// List of elisions to remove. + /// To be removed, the elision must be at the beginning of a token and be immediately followed by an apostrophe. Both the elision and apostrophe are removed. + /// For custom elision filters, either this parameter or articles_path must be specified. + /// + /// public System.Collections.Generic.ICollection? Articles { get; set; } + + /// + /// + /// If true, elision matching is case insensitive. If false, elision matching is case sensitive. Defaults to false. + /// + /// public bool? ArticlesCase { get; set; } + + /// + /// + /// Path to a file that contains a list of elisions to remove. + /// This path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each elision in the file must be separated by a line break. + /// To be removed, the elision must be at the beginning of a token and be immediately followed by an apostrophe. Both the elision and apostrophe are removed. + /// For custom elision filters, either this parameter or articles must be specified. + /// + /// public string? ArticlesPath { get; set; } public string Type => "elision"; @@ -144,24 +166,51 @@ public ElisionTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.ElisionTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.ElisionTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.ElisionTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.ElisionTokenFilter(Elastic.Clients.Elasticsearch.Analysis.ElisionTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// List of elisions to remove. + /// To be removed, the elision must be at the beginning of a token and be immediately followed by an apostrophe. Both the elision and apostrophe are removed. + /// For custom elision filters, either this parameter or articles_path must be specified. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.ElisionTokenFilterDescriptor Articles(System.Collections.Generic.ICollection? value) { Instance.Articles = value; return this; } + /// + /// + /// List of elisions to remove. + /// To be removed, the elision must be at the beginning of a token and be immediately followed by an apostrophe. Both the elision and apostrophe are removed. + /// For custom elision filters, either this parameter or articles_path must be specified. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.ElisionTokenFilterDescriptor Articles(params string[] values) { Instance.Articles = [.. values]; return this; } + /// + /// + /// If true, elision matching is case insensitive. If false, elision matching is case sensitive. Defaults to false. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.ElisionTokenFilterDescriptor ArticlesCase(bool? value = true) { Instance.ArticlesCase = value; return this; } + /// + /// + /// Path to a file that contains a list of elisions to remove. + /// This path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each elision in the file must be separated by a line break. + /// To be removed, the elision must be at the beginning of a token and be immediately followed by an apostrophe. Both the elision and apostrophe are removed. + /// For custom elision filters, either this parameter or articles must be specified. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.ElisionTokenFilterDescriptor ArticlesPath(string? value) { Instance.ArticlesPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EnglishAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EnglishAnalyzer.g.cs index 747c47462d..6d9df6980a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EnglishAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EnglishAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.EnglishAnalyzer Read(ref { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.EnglishAnalyzer Read(ref continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal EnglishAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstru } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "english"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.EnglishAnalyzerDescriptor StemExcl return this; } - public Elastic.Clients.Elasticsearch.Analysis.EnglishAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.EnglishAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.EnglishAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.EnglishAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EstonianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EstonianAnalyzer.g.cs index d60d66e6f7..09c3993afe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EstonianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/EstonianAnalyzer.g.cs @@ -32,11 +32,11 @@ internal sealed partial class EstonianAnalyzerConverter : System.Text.Json.Seria public override Elastic.Clients.Elasticsearch.Analysis.EstonianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -72,7 +72,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.EstonianAnalyzer Read(ref public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.EstonianAnalyzer value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -98,7 +98,7 @@ internal EstonianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstr _ = sentinel; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "estonian"; @@ -123,18 +123,12 @@ public EstonianAnalyzerDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.EstonianAnalyzerDescriptor(Elastic.Clients.Elasticsearch.Analysis.EstonianAnalyzer instance) => new Elastic.Clients.Elasticsearch.Analysis.EstonianAnalyzerDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.EstonianAnalyzer(Elastic.Clients.Elasticsearch.Analysis.EstonianAnalyzerDescriptor descriptor) => descriptor.Instance; - public Elastic.Clients.Elasticsearch.Analysis.EstonianAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.EstonianAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.EstonianAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.EstonianAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintAnalyzer.g.cs index baaf1d4d66..46b8c9ec3a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintAnalyzer.g.cs @@ -37,7 +37,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.FingerprintAnalyzer Read( reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propMaxOutputSize = default; LocalJsonValue propSeparator = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; LocalJsonValue propVersion = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) @@ -52,7 +52,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.FingerprintAnalyzer Read( continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -100,7 +100,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteStartObject(); writer.WriteProperty(options, PropMaxOutputSize, value.MaxOutputSize, null, null); writer.WriteProperty(options, PropSeparator, value.Separator, null, null); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); #pragma warning disable CS0618 @@ -152,7 +152,7 @@ internal FingerprintAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonCon /// Defaults to _none_. /// /// - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } /// /// @@ -216,24 +216,12 @@ public Elastic.Clients.Elasticsearch.Analysis.FingerprintAnalyzerDescriptor Sepa /// Defaults to _none_. /// /// - public Elastic.Clients.Elasticsearch.Analysis.FingerprintAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.FingerprintAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - /// - /// - /// A pre-defined stop words list like _english_ or an array containing a list of stop words. - /// Defaults to _none_. - /// - /// - public Elastic.Clients.Elasticsearch.Analysis.FingerprintAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - /// /// /// The path to a file containing stop words. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintTokenFilter.g.cs index e205e5d880..4d34473760 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FingerprintTokenFilter.g.cs @@ -107,7 +107,18 @@ internal FingerprintTokenFilter(Elastic.Clients.Elasticsearch.Serialization.Json _ = sentinel; } + /// + /// + /// Maximum character length, including whitespace, of the output token. Defaults to 255. Concatenated tokens longer than this will result in no token output. + /// + /// public int? MaxOutputSize { get; set; } + + /// + /// + /// Character to use to concatenate the token stream input. Defaults to a space. + /// + /// public string? Separator { get; set; } public string Type => "fingerprint"; @@ -134,12 +145,22 @@ public FingerprintTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.FingerprintTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.FingerprintTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.FingerprintTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.FingerprintTokenFilter(Elastic.Clients.Elasticsearch.Analysis.FingerprintTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// Maximum character length, including whitespace, of the output token. Defaults to 255. Concatenated tokens longer than this will result in no token output. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.FingerprintTokenFilterDescriptor MaxOutputSize(int? value) { Instance.MaxOutputSize = value; return this; } + /// + /// + /// Character to use to concatenate the token stream input. Defaults to a space. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.FingerprintTokenFilterDescriptor Separator(string? value) { Instance.Separator = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FinnishAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FinnishAnalyzer.g.cs index 6ac71741bb..d8982dd30d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FinnishAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FinnishAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.FinnishAnalyzer Read(ref { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.FinnishAnalyzer Read(ref continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal FinnishAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstru } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "finnish"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.FinnishAnalyzerDescriptor StemExcl return this; } - public Elastic.Clients.Elasticsearch.Analysis.FinnishAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.FinnishAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.FinnishAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.FinnishAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FlattenGraphTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FlattenGraphTokenFilter.g.cs new file mode 100644 index 0000000000..d522c9ad8a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FlattenGraphTokenFilter.g.cs @@ -0,0 +1,134 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +internal sealed partial class FlattenGraphTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilterConverter))] +public sealed partial class FlattenGraphTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter +{ +#if NET7_0_OR_GREATER + public FlattenGraphTokenFilter() + { + } +#endif +#if !NET7_0_OR_GREATER + public FlattenGraphTokenFilter() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal FlattenGraphTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public string Type => "flatten_graph"; + + public string? Version { get; set; } +} + +public readonly partial struct FlattenGraphTokenFilterDescriptor +{ + internal Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilter Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public FlattenGraphTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilter instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public FlattenGraphTokenFilterDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilterDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilter(Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilterDescriptor descriptor) => descriptor.Instance; + + public Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilterDescriptor Version(string? value) + { + Instance.Version = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilter Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilterDescriptor(new Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FrenchAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FrenchAnalyzer.g.cs index 9bd942805c..b5b08bacf0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FrenchAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/FrenchAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.FrenchAnalyzer Read(ref S { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.FrenchAnalyzer Read(ref S continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal FrenchAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstruc } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "french"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.FrenchAnalyzerDescriptor StemExclu return this; } - public Elastic.Clients.Elasticsearch.Analysis.FrenchAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.FrenchAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.FrenchAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.FrenchAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GalicianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GalicianAnalyzer.g.cs index 9f8ab1904d..18df0c1850 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GalicianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GalicianAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.GalicianAnalyzer Read(ref { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.GalicianAnalyzer Read(ref continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal GalicianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstr } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "galician"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.GalicianAnalyzerDescriptor StemExc return this; } - public Elastic.Clients.Elasticsearch.Analysis.GalicianAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.GalicianAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.GalicianAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.GalicianAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanAnalyzer.g.cs index 1c753fb903..fa87c243d3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.GermanAnalyzer Read(ref S { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.GermanAnalyzer Read(ref S continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal GermanAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstruc } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "german"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.GermanAnalyzerDescriptor StemExclu return this; } - public Elastic.Clients.Elasticsearch.Analysis.GermanAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.GermanAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.GermanAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.GermanAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanNormalizationTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanNormalizationTokenFilter.g.cs new file mode 100644 index 0000000000..28f532a6b3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GermanNormalizationTokenFilter.g.cs @@ -0,0 +1,134 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +internal sealed partial class GermanNormalizationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilterConverter))] +public sealed partial class GermanNormalizationTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter +{ +#if NET7_0_OR_GREATER + public GermanNormalizationTokenFilter() + { + } +#endif +#if !NET7_0_OR_GREATER + public GermanNormalizationTokenFilter() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal GermanNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public string Type => "german_normalization"; + + public string? Version { get; set; } +} + +public readonly partial struct GermanNormalizationTokenFilterDescriptor +{ + internal Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilter Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public GermanNormalizationTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilter instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public GermanNormalizationTokenFilterDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilterDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilterDescriptor descriptor) => descriptor.Instance; + + public Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilterDescriptor Version(string? value) + { + Instance.Version = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilter Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilterDescriptor(new Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GreekAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GreekAnalyzer.g.cs index ffa883163a..39782e1f0b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GreekAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/GreekAnalyzer.g.cs @@ -32,11 +32,11 @@ internal sealed partial class GreekAnalyzerConverter : System.Text.Json.Serializ public override Elastic.Clients.Elasticsearch.Analysis.GreekAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -72,7 +72,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.GreekAnalyzer Read(ref Sy public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.GreekAnalyzer value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -98,7 +98,7 @@ internal GreekAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstruct _ = sentinel; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "greek"; @@ -123,18 +123,12 @@ public GreekAnalyzerDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.GreekAnalyzerDescriptor(Elastic.Clients.Elasticsearch.Analysis.GreekAnalyzer instance) => new Elastic.Clients.Elasticsearch.Analysis.GreekAnalyzerDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.GreekAnalyzer(Elastic.Clients.Elasticsearch.Analysis.GreekAnalyzerDescriptor descriptor) => descriptor.Instance; - public Elastic.Clients.Elasticsearch.Analysis.GreekAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.GreekAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.GreekAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.GreekAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HindiAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HindiAnalyzer.g.cs index f917dc97c4..e0832e8ec4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HindiAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HindiAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.HindiAnalyzer Read(ref Sy { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.HindiAnalyzer Read(ref Sy continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal HindiAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstruct } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "hindi"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.HindiAnalyzerDescriptor StemExclus return this; } - public Elastic.Clients.Elasticsearch.Analysis.HindiAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.HindiAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.HindiAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.HindiAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HindiNormalizationTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HindiNormalizationTokenFilter.g.cs new file mode 100644 index 0000000000..0caac9c381 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HindiNormalizationTokenFilter.g.cs @@ -0,0 +1,134 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +internal sealed partial class HindiNormalizationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilterConverter))] +public sealed partial class HindiNormalizationTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter +{ +#if NET7_0_OR_GREATER + public HindiNormalizationTokenFilter() + { + } +#endif +#if !NET7_0_OR_GREATER + public HindiNormalizationTokenFilter() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal HindiNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public string Type => "hindi_normalization"; + + public string? Version { get; set; } +} + +public readonly partial struct HindiNormalizationTokenFilterDescriptor +{ + internal Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilter Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public HindiNormalizationTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilter instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public HindiNormalizationTokenFilterDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilterDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilterDescriptor descriptor) => descriptor.Instance; + + public Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilterDescriptor Version(string? value) + { + Instance.Version = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilter Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilterDescriptor(new Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HungarianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HungarianAnalyzer.g.cs index 1d30fd2766..b762535c21 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HungarianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HungarianAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.HungarianAnalyzer Read(re { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.HungarianAnalyzer Read(re continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal HungarianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConst } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "hungarian"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.HungarianAnalyzerDescriptor StemEx return this; } - public Elastic.Clients.Elasticsearch.Analysis.HungarianAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.HungarianAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.HungarianAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.HungarianAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HunspellTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HunspellTokenFilter.g.cs index 963a48f8da..91dac422e7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HunspellTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HunspellTokenFilter.g.cs @@ -28,6 +28,8 @@ internal sealed partial class HunspellTokenFilterConverter : System.Text.Json.Se private static readonly System.Text.Json.JsonEncodedText PropDedup = System.Text.Json.JsonEncodedText.Encode("dedup"); private static readonly System.Text.Json.JsonEncodedText PropDictionary = System.Text.Json.JsonEncodedText.Encode("dictionary"); private static readonly System.Text.Json.JsonEncodedText PropLocale = System.Text.Json.JsonEncodedText.Encode("locale"); + private static readonly System.Text.Json.JsonEncodedText PropLocale1 = System.Text.Json.JsonEncodedText.Encode("lang"); + private static readonly System.Text.Json.JsonEncodedText PropLocale2 = System.Text.Json.JsonEncodedText.Encode("language"); private static readonly System.Text.Json.JsonEncodedText PropLongestOnly = System.Text.Json.JsonEncodedText.Encode("longest_only"); private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); @@ -52,7 +54,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.HunspellTokenFilter Read( continue; } - if (propLocale.TryReadProperty(ref reader, options, PropLocale, null)) + if (propLocale.TryReadProperty(ref reader, options, PropLocale, null) || propLocale.TryReadProperty(ref reader, options, PropLocale1, null) || propLocale.TryReadProperty(ref reader, options, PropLocale2, null)) { continue; } @@ -131,13 +133,37 @@ internal HunspellTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonCon _ = sentinel; } + /// + /// + /// If true, duplicate tokens are removed from the filter’s output. Defaults to true. + /// + /// public bool? Dedup { get; set; } + + /// + /// + /// One or more .dic files (e.g, en_US.dic, my_custom.dic) to use for the Hunspell dictionary. + /// By default, the hunspell filter uses all .dic files in the <$ES_PATH_CONF>/hunspell/<locale> directory specified using the lang, language, or locale parameter. + /// + /// public string? Dictionary { get; set; } + + /// + /// + /// Locale directory used to specify the .aff and .dic files for a Hunspell dictionary. + /// + /// public #if NET7_0_OR_GREATER required #endif string Locale { get; set; } + + /// + /// + /// If true, only the longest stemmed version of each token is included in the output. If false, all stemmed versions of the token are included. Defaults to false. + /// + /// public bool? LongestOnly { get; set; } public string Type => "hunspell"; @@ -164,24 +190,45 @@ public HunspellTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.HunspellTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.HunspellTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.HunspellTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.HunspellTokenFilter(Elastic.Clients.Elasticsearch.Analysis.HunspellTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// If true, duplicate tokens are removed from the filter’s output. Defaults to true. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.HunspellTokenFilterDescriptor Dedup(bool? value = true) { Instance.Dedup = value; return this; } + /// + /// + /// One or more .dic files (e.g, en_US.dic, my_custom.dic) to use for the Hunspell dictionary. + /// By default, the hunspell filter uses all .dic files in the <$ES_PATH_CONF>/hunspell/<locale> directory specified using the lang, language, or locale parameter. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.HunspellTokenFilterDescriptor Dictionary(string? value) { Instance.Dictionary = value; return this; } + /// + /// + /// Locale directory used to specify the .aff and .dic files for a Hunspell dictionary. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.HunspellTokenFilterDescriptor Locale(string value) { Instance.Locale = value; return this; } + /// + /// + /// If true, only the longest stemmed version of each token is included in the output. If false, all stemmed versions of the token are included. Defaults to false. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.HunspellTokenFilterDescriptor LongestOnly(bool? value = true) { Instance.LongestOnly = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HyphenationDecompounderTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HyphenationDecompounderTokenFilter.g.cs index 5f94c93716..3e367e2d74 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HyphenationDecompounderTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/HyphenationDecompounderTokenFilter.g.cs @@ -29,6 +29,8 @@ internal sealed partial class HyphenationDecompounderTokenFilterConverter : Syst private static readonly System.Text.Json.JsonEncodedText PropMaxSubwordSize = System.Text.Json.JsonEncodedText.Encode("max_subword_size"); private static readonly System.Text.Json.JsonEncodedText PropMinSubwordSize = System.Text.Json.JsonEncodedText.Encode("min_subword_size"); private static readonly System.Text.Json.JsonEncodedText PropMinWordSize = System.Text.Json.JsonEncodedText.Encode("min_word_size"); + private static readonly System.Text.Json.JsonEncodedText PropNoOverlappingMatches = System.Text.Json.JsonEncodedText.Encode("no_overlapping_matches"); + private static readonly System.Text.Json.JsonEncodedText PropNoSubMatches = System.Text.Json.JsonEncodedText.Encode("no_sub_matches"); private static readonly System.Text.Json.JsonEncodedText PropOnlyLongestMatch = System.Text.Json.JsonEncodedText.Encode("only_longest_match"); private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); @@ -38,10 +40,12 @@ internal sealed partial class HyphenationDecompounderTokenFilterConverter : Syst public override Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propHyphenationPatternsPath = default; + LocalJsonValue propHyphenationPatternsPath = default; LocalJsonValue propMaxSubwordSize = default; LocalJsonValue propMinSubwordSize = default; LocalJsonValue propMinWordSize = default; + LocalJsonValue propNoOverlappingMatches = default; + LocalJsonValue propNoSubMatches = default; LocalJsonValue propOnlyLongestMatch = default; LocalJsonValue propVersion = default; LocalJsonValue?> propWordList = default; @@ -68,6 +72,16 @@ public override Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTo continue; } + if (propNoOverlappingMatches.TryReadProperty(ref reader, options, PropNoOverlappingMatches, null)) + { + continue; + } + + if (propNoSubMatches.TryReadProperty(ref reader, options, PropNoSubMatches, null)) + { + continue; + } + if (propOnlyLongestMatch.TryReadProperty(ref reader, options, PropOnlyLongestMatch, null)) { continue; @@ -110,6 +124,8 @@ public override Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTo MaxSubwordSize = propMaxSubwordSize.Value, MinSubwordSize = propMinSubwordSize.Value, MinWordSize = propMinWordSize.Value, + NoOverlappingMatches = propNoOverlappingMatches.Value, + NoSubMatches = propNoSubMatches.Value, OnlyLongestMatch = propOnlyLongestMatch.Value, Version = propVersion.Value, WordList = propWordList.Value, @@ -124,6 +140,8 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropMaxSubwordSize, value.MaxSubwordSize, null, null); writer.WriteProperty(options, PropMinSubwordSize, value.MinSubwordSize, null, null); writer.WriteProperty(options, PropMinWordSize, value.MinWordSize, null, null); + writer.WriteProperty(options, PropNoOverlappingMatches, value.NoOverlappingMatches, null, null); + writer.WriteProperty(options, PropNoSubMatches, value.NoSubMatches, null, null); writer.WriteProperty(options, PropOnlyLongestMatch, value.OnlyLongestMatch, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteProperty(options, PropVersion, value.Version, null, null); @@ -136,12 +154,18 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilterConverter))] public sealed partial class HyphenationDecompounderTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public HyphenationDecompounderTokenFilter(string hyphenationPatternsPath) + { + HyphenationPatternsPath = hyphenationPatternsPath; + } #if NET7_0_OR_GREATER public HyphenationDecompounderTokenFilter() { } #endif #if !NET7_0_OR_GREATER + [System.Obsolete("The type contains required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] public HyphenationDecompounderTokenFilter() { } @@ -152,16 +176,79 @@ internal HyphenationDecompounderTokenFilter(Elastic.Clients.Elasticsearch.Serial _ = sentinel; } - public string? HyphenationPatternsPath { get; set; } + /// + /// + /// Path to an Apache FOP (Formatting Objects Processor) XML hyphenation pattern file. + /// This path must be absolute or relative to the config location. Only FOP v1.2 compatible files are supported. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + string HyphenationPatternsPath { get; set; } + + /// + /// + /// Maximum subword character length. Longer subword tokens are excluded from the output. Defaults to 15. + /// + /// public int? MaxSubwordSize { get; set; } + + /// + /// + /// Minimum subword character length. Shorter subword tokens are excluded from the output. Defaults to 2. + /// + /// public int? MinSubwordSize { get; set; } + + /// + /// + /// Minimum word character length. Shorter word tokens are excluded from the output. Defaults to 5. + /// + /// public int? MinWordSize { get; set; } + + /// + /// + /// If true, do not allow overlapping tokens. Defaults to false. + /// + /// + public bool? NoOverlappingMatches { get; set; } + + /// + /// + /// If true, do not match sub tokens in tokens that are in the word list. Defaults to false. + /// + /// + public bool? NoSubMatches { get; set; } + + /// + /// + /// If true, only include the longest matching subword. Defaults to false. + /// + /// public bool? OnlyLongestMatch { get; set; } public string Type => "hyphenation_decompounder"; public string? Version { get; set; } + + /// + /// + /// A list of subwords to look for in the token stream. If found, the subword is included in the token output. + /// Either this parameter or word_list_path must be specified. + /// + /// public System.Collections.Generic.ICollection? WordList { get; set; } + + /// + /// + /// Path to a file that contains a list of subwords to find in the token stream. If found, the subword is included in the token output. + /// This path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each token in the file must be separated by a line break. + /// Either this parameter or word_list must be specified. + /// + /// public string? WordListPath { get; set; } } @@ -184,30 +271,78 @@ public HyphenationDecompounderTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilter(Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilterDescriptor descriptor) => descriptor.Instance; - public Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilterDescriptor HyphenationPatternsPath(string? value) + /// + /// + /// Path to an Apache FOP (Formatting Objects Processor) XML hyphenation pattern file. + /// This path must be absolute or relative to the config location. Only FOP v1.2 compatible files are supported. + /// + /// + public Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilterDescriptor HyphenationPatternsPath(string value) { Instance.HyphenationPatternsPath = value; return this; } + /// + /// + /// Maximum subword character length. Longer subword tokens are excluded from the output. Defaults to 15. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilterDescriptor MaxSubwordSize(int? value) { Instance.MaxSubwordSize = value; return this; } + /// + /// + /// Minimum subword character length. Shorter subword tokens are excluded from the output. Defaults to 2. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilterDescriptor MinSubwordSize(int? value) { Instance.MinSubwordSize = value; return this; } + /// + /// + /// Minimum word character length. Shorter word tokens are excluded from the output. Defaults to 5. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilterDescriptor MinWordSize(int? value) { Instance.MinWordSize = value; return this; } + /// + /// + /// If true, do not allow overlapping tokens. Defaults to false. + /// + /// + public Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilterDescriptor NoOverlappingMatches(bool? value = true) + { + Instance.NoOverlappingMatches = value; + return this; + } + + /// + /// + /// If true, do not match sub tokens in tokens that are in the word list. Defaults to false. + /// + /// + public Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilterDescriptor NoSubMatches(bool? value = true) + { + Instance.NoSubMatches = value; + return this; + } + + /// + /// + /// If true, only include the longest matching subword. Defaults to false. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilterDescriptor OnlyLongestMatch(bool? value = true) { Instance.OnlyLongestMatch = value; @@ -220,18 +355,37 @@ public Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilter return this; } + /// + /// + /// A list of subwords to look for in the token stream. If found, the subword is included in the token output. + /// Either this parameter or word_list_path must be specified. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilterDescriptor WordList(System.Collections.Generic.ICollection? value) { Instance.WordList = value; return this; } + /// + /// + /// A list of subwords to look for in the token stream. If found, the subword is included in the token output. + /// Either this parameter or word_list_path must be specified. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilterDescriptor WordList(params string[] values) { Instance.WordList = [.. values]; return this; } + /// + /// + /// Path to a file that contains a list of subwords to find in the token stream. If found, the subword is included in the token output. + /// This path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each token in the file must be separated by a line break. + /// Either this parameter or word_list must be specified. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilterDescriptor WordListPath(string? value) { Instance.WordListPath = value; @@ -239,13 +393,8 @@ public Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilter } [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - internal static Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilter Build(System.Action? action) + internal static Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilter Build(System.Action action) { - if (action is null) - { - return new Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); - } - var builder = new Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilterDescriptor(new Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); action.Invoke(builder); return builder.Instance; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationCharFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationCharFilter.g.cs index aac6621150..bfbc16f982 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationCharFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IcuNormalizationCharFilter.g.cs @@ -28,6 +28,7 @@ internal sealed partial class IcuNormalizationCharFilterConverter : System.Text. private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropUnicodeSetFilter = System.Text.Json.JsonEncodedText.Encode("unicode_set_filter"); private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); public override Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationCharFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) @@ -35,6 +36,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationCharFilte reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propMode = default; LocalJsonValue propName = default; + LocalJsonValue propUnicodeSetFilter = default; LocalJsonValue propVersion = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -54,6 +56,11 @@ public override Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationCharFilte continue; } + if (propUnicodeSetFilter.TryReadProperty(ref reader, options, PropUnicodeSetFilter, null)) + { + continue; + } + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) { continue; @@ -73,6 +80,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationCharFilte { Mode = propMode.Value, Name = propName.Value, + UnicodeSetFilter = propUnicodeSetFilter.Value, Version = propVersion.Value }; } @@ -83,6 +91,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropMode, value.Mode, null, null); writer.WriteProperty(options, PropName, value.Name, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropUnicodeSetFilter, value.UnicodeSetFilter, null, null); writer.WriteProperty(options, PropVersion, value.Version, null, null); writer.WriteEndObject(); } @@ -112,6 +121,7 @@ internal IcuNormalizationCharFilter(Elastic.Clients.Elasticsearch.Serialization. public string Type => "icu_normalizer"; + public string? UnicodeSetFilter { get; set; } public string? Version { get; set; } } @@ -146,6 +156,12 @@ public Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationCharFilterDescript return this; } + public Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationCharFilterDescriptor UnicodeSetFilter(string? value) + { + Instance.UnicodeSetFilter = value; + return this; + } + public Elastic.Clients.Elasticsearch.Analysis.IcuNormalizationCharFilterDescriptor Version(string? value) { Instance.Version = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IndicNormalizationTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IndicNormalizationTokenFilter.g.cs new file mode 100644 index 0000000000..a69f133e9b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IndicNormalizationTokenFilter.g.cs @@ -0,0 +1,134 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +internal sealed partial class IndicNormalizationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilterConverter))] +public sealed partial class IndicNormalizationTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter +{ +#if NET7_0_OR_GREATER + public IndicNormalizationTokenFilter() + { + } +#endif +#if !NET7_0_OR_GREATER + public IndicNormalizationTokenFilter() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal IndicNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public string Type => "indic_normalization"; + + public string? Version { get; set; } +} + +public readonly partial struct IndicNormalizationTokenFilterDescriptor +{ + internal Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilter Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public IndicNormalizationTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilter instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public IndicNormalizationTokenFilterDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilterDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilterDescriptor descriptor) => descriptor.Instance; + + public Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilterDescriptor Version(string? value) + { + Instance.Version = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilter Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilterDescriptor(new Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IndonesianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IndonesianAnalyzer.g.cs index 8834a70a12..23a9fb9ad1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IndonesianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IndonesianAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.IndonesianAnalyzer Read(r { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.IndonesianAnalyzer Read(r continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal IndonesianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonCons } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "indonesian"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.IndonesianAnalyzerDescriptor StemE return this; } - public Elastic.Clients.Elasticsearch.Analysis.IndonesianAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.IndonesianAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.IndonesianAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.IndonesianAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IrishAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IrishAnalyzer.g.cs index fe4512ebb8..a16138cd1f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IrishAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/IrishAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.IrishAnalyzer Read(ref Sy { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.IrishAnalyzer Read(ref Sy continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal IrishAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstruct } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "irish"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.IrishAnalyzerDescriptor StemExclus return this; } - public Elastic.Clients.Elasticsearch.Analysis.IrishAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.IrishAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.IrishAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.IrishAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ItalianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ItalianAnalyzer.g.cs index cc6799a368..38c2d72e4e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ItalianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ItalianAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.ItalianAnalyzer Read(ref { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.ItalianAnalyzer Read(ref continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal ItalianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstru } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "italian"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.ItalianAnalyzerDescriptor StemExcl return this; } - public Elastic.Clients.Elasticsearch.Analysis.ItalianAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.ItalianAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.ItalianAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.ItalianAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/JaStopTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/JaStopTokenFilter.g.cs new file mode 100644 index 0000000000..929634d800 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/JaStopTokenFilter.g.cs @@ -0,0 +1,151 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +internal sealed partial class JaStopTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropStopwords = System.Text.Json.JsonEncodedText.Encode("stopwords"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue>?> propStopwords = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Stopwords = propStopwords.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilterConverter))] +public sealed partial class JaStopTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter +{ +#if NET7_0_OR_GREATER + public JaStopTokenFilter() + { + } +#endif +#if !NET7_0_OR_GREATER + public JaStopTokenFilter() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal JaStopTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } + + public string Type => "ja_stop"; + + public string? Version { get; set; } +} + +public readonly partial struct JaStopTokenFilterDescriptor +{ + internal Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilter Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public JaStopTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilter instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public JaStopTokenFilterDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilterDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilter(Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilterDescriptor descriptor) => descriptor.Instance; + + public Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilterDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) + { + Instance.Stopwords = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilterDescriptor Version(string? value) + { + Instance.Version = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilter Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilterDescriptor(new Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepTypesTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepTypesTokenFilter.g.cs index 1c05f497a7..4fb527194f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepTypesTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepTypesTokenFilter.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilter Read { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propMode = default; - LocalJsonValue?> propTypes = default; + LocalJsonValue> propTypes = default; LocalJsonValue propVersion = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -49,7 +49,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilter Read continue; } - if (propTypes.TryReadProperty(ref reader, options, PropTypes, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + if (propTypes.TryReadProperty(ref reader, options, PropTypes, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) { continue; } @@ -82,7 +82,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteStartObject(); writer.WriteProperty(options, PropMode, value.Mode, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); - writer.WriteProperty(options, PropTypes, value.Types, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropTypes, value.Types, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); writer.WriteProperty(options, PropVersion, value.Version, null, null); writer.WriteEndObject(); } @@ -91,12 +91,18 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilterConverter))] public sealed partial class KeepTypesTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter { + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public KeepTypesTokenFilter(System.Collections.Generic.ICollection types) + { + Types = types; + } #if NET7_0_OR_GREATER public KeepTypesTokenFilter() { } #endif #if !NET7_0_OR_GREATER + [System.Obsolete("The type contains required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] public KeepTypesTokenFilter() { } @@ -107,11 +113,25 @@ internal KeepTypesTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonCo _ = sentinel; } + /// + /// + /// Indicates whether to keep or remove the specified token types. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode? Mode { get; set; } public string Type => "keep_types"; - public System.Collections.Generic.ICollection? Types { get; set; } + /// + /// + /// List of token types to keep or remove. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + System.Collections.Generic.ICollection Types { get; set; } public string? Version { get; set; } } @@ -134,18 +154,33 @@ public KeepTypesTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilter(Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// Indicates whether to keep or remove the specified token types. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilterDescriptor Mode(Elastic.Clients.Elasticsearch.Analysis.KeepTypesMode? value) { Instance.Mode = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilterDescriptor Types(System.Collections.Generic.ICollection? value) + /// + /// + /// List of token types to keep or remove. + /// + /// + public Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilterDescriptor Types(System.Collections.Generic.ICollection value) { Instance.Types = value; return this; } + /// + /// + /// List of token types to keep or remove. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilterDescriptor Types(params string[] values) { Instance.Types = [.. values]; @@ -159,13 +194,8 @@ public Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilterDescriptor Ver } [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - internal static Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilter Build(System.Action? action) + internal static Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilter Build(System.Action action) { - if (action is null) - { - return new Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); - } - var builder = new Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilterDescriptor(new Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); action.Invoke(builder); return builder.Instance; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepWordsTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepWordsTokenFilter.g.cs index 9869f9335c..aacbee3b49 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepWordsTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeepWordsTokenFilter.g.cs @@ -116,8 +116,28 @@ internal KeepWordsTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonCo _ = sentinel; } + /// + /// + /// List of words to keep. Only tokens that match words in this list are included in the output. + /// Either this parameter or keep_words_path must be specified. + /// + /// public System.Collections.Generic.ICollection? KeepWords { get; set; } + + /// + /// + /// If true, lowercase all keep words. Defaults to false. + /// + /// public bool? KeepWordsCase { get; set; } + + /// + /// + /// Path to a file that contains a list of words to keep. Only tokens that match words in this list are included in the output. + /// This path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each word in the file must be separated by a line break. + /// Either this parameter or keep_words must be specified. + /// + /// public string? KeepWordsPath { get; set; } public string Type => "keep"; @@ -144,24 +164,48 @@ public KeepWordsTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.KeepWordsTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.KeepWordsTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.KeepWordsTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.KeepWordsTokenFilter(Elastic.Clients.Elasticsearch.Analysis.KeepWordsTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// List of words to keep. Only tokens that match words in this list are included in the output. + /// Either this parameter or keep_words_path must be specified. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.KeepWordsTokenFilterDescriptor KeepWords(System.Collections.Generic.ICollection? value) { Instance.KeepWords = value; return this; } + /// + /// + /// List of words to keep. Only tokens that match words in this list are included in the output. + /// Either this parameter or keep_words_path must be specified. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.KeepWordsTokenFilterDescriptor KeepWords(params string[] values) { Instance.KeepWords = [.. values]; return this; } + /// + /// + /// If true, lowercase all keep words. Defaults to false. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.KeepWordsTokenFilterDescriptor KeepWordsCase(bool? value = true) { Instance.KeepWordsCase = value; return this; } + /// + /// + /// Path to a file that contains a list of words to keep. Only tokens that match words in this list are included in the output. + /// This path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each word in the file must be separated by a line break. + /// Either this parameter or keep_words must be specified. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.KeepWordsTokenFilterDescriptor KeepWordsPath(string? value) { Instance.KeepWordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordMarkerTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordMarkerTokenFilter.g.cs index a70b3ffcef..1835a46007 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordMarkerTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordMarkerTokenFilter.g.cs @@ -125,9 +125,36 @@ internal KeywordMarkerTokenFilter(Elastic.Clients.Elasticsearch.Serialization.Js _ = sentinel; } + /// + /// + /// If true, matching for the keywords and keywords_path parameters ignores letter case. Defaults to false. + /// + /// public bool? IgnoreCase { get; set; } + + /// + /// + /// Array of keywords. Tokens that match these keywords are not stemmed. + /// This parameter, keywords_path, or keywords_pattern must be specified. You cannot specify this parameter and keywords_pattern. + /// + /// public System.Collections.Generic.ICollection? Keywords { get; set; } + + /// + /// + /// Path to a file that contains a list of keywords. Tokens that match these keywords are not stemmed. + /// This path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each word in the file must be separated by a line break. + /// This parameter, keywords, or keywords_pattern must be specified. You cannot specify this parameter and keywords_pattern. + /// + /// public string? KeywordsPath { get; set; } + + /// + /// + /// Java regular expression used to match tokens. Tokens that match this expression are marked as keywords and not stemmed. + /// This parameter, keywords, or keywords_path must be specified. You cannot specify this parameter and keywords or keywords_pattern. + /// + /// public string? KeywordsPattern { get; set; } public string Type => "keyword_marker"; @@ -154,30 +181,60 @@ public KeywordMarkerTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.KeywordMarkerTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.KeywordMarkerTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.KeywordMarkerTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.KeywordMarkerTokenFilter(Elastic.Clients.Elasticsearch.Analysis.KeywordMarkerTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// If true, matching for the keywords and keywords_path parameters ignores letter case. Defaults to false. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.KeywordMarkerTokenFilterDescriptor IgnoreCase(bool? value = true) { Instance.IgnoreCase = value; return this; } + /// + /// + /// Array of keywords. Tokens that match these keywords are not stemmed. + /// This parameter, keywords_path, or keywords_pattern must be specified. You cannot specify this parameter and keywords_pattern. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.KeywordMarkerTokenFilterDescriptor Keywords(System.Collections.Generic.ICollection? value) { Instance.Keywords = value; return this; } + /// + /// + /// Array of keywords. Tokens that match these keywords are not stemmed. + /// This parameter, keywords_path, or keywords_pattern must be specified. You cannot specify this parameter and keywords_pattern. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.KeywordMarkerTokenFilterDescriptor Keywords(params string[] values) { Instance.Keywords = [.. values]; return this; } + /// + /// + /// Path to a file that contains a list of keywords. Tokens that match these keywords are not stemmed. + /// This path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each word in the file must be separated by a line break. + /// This parameter, keywords, or keywords_pattern must be specified. You cannot specify this parameter and keywords_pattern. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.KeywordMarkerTokenFilterDescriptor KeywordsPath(string? value) { Instance.KeywordsPath = value; return this; } + /// + /// + /// Java regular expression used to match tokens. Tokens that match this expression are marked as keywords and not stemmed. + /// This parameter, keywords, or keywords_path must be specified. You cannot specify this parameter and keywords or keywords_pattern. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.KeywordMarkerTokenFilterDescriptor KeywordsPattern(string? value) { Instance.KeywordsPattern = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordRepeatTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordRepeatTokenFilter.g.cs new file mode 100644 index 0000000000..99aaa10cae --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KeywordRepeatTokenFilter.g.cs @@ -0,0 +1,134 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +internal sealed partial class KeywordRepeatTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilterConverter))] +public sealed partial class KeywordRepeatTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter +{ +#if NET7_0_OR_GREATER + public KeywordRepeatTokenFilter() + { + } +#endif +#if !NET7_0_OR_GREATER + public KeywordRepeatTokenFilter() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal KeywordRepeatTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public string Type => "keyword_repeat"; + + public string? Version { get; set; } +} + +public readonly partial struct KeywordRepeatTokenFilterDescriptor +{ + internal Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilter Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public KeywordRepeatTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilter instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public KeywordRepeatTokenFilterDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilterDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilter(Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilterDescriptor descriptor) => descriptor.Instance; + + public Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilterDescriptor Version(string? value) + { + Instance.Version = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilter Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilterDescriptor(new Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LatvianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LatvianAnalyzer.g.cs index 8a442a5fef..36aebd55fc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LatvianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LatvianAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.LatvianAnalyzer Read(ref { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.LatvianAnalyzer Read(ref continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal LatvianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstru } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "latvian"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.LatvianAnalyzerDescriptor StemExcl return this; } - public Elastic.Clients.Elasticsearch.Analysis.LatvianAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.LatvianAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.LatvianAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.LatvianAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LengthTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LengthTokenFilter.g.cs index acaa31a219..f275e71939 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LengthTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LengthTokenFilter.g.cs @@ -107,7 +107,18 @@ internal LengthTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConst _ = sentinel; } + /// + /// + /// Maximum character length of a token. Longer tokens are excluded from the output. Defaults to Integer.MAX_VALUE, which is 2^31-1 or 2147483647. + /// + /// public int? Max { get; set; } + + /// + /// + /// Minimum character length of a token. Shorter tokens are excluded from the output. Defaults to 0. + /// + /// public int? Min { get; set; } public string Type => "length"; @@ -134,12 +145,22 @@ public LengthTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.LengthTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.LengthTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.LengthTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.LengthTokenFilter(Elastic.Clients.Elasticsearch.Analysis.LengthTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// Maximum character length of a token. Longer tokens are excluded from the output. Defaults to Integer.MAX_VALUE, which is 2^31-1 or 2147483647. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.LengthTokenFilterDescriptor Max(int? value) { Instance.Max = value; return this; } + /// + /// + /// Minimum character length of a token. Shorter tokens are excluded from the output. Defaults to 0. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.LengthTokenFilterDescriptor Min(int? value) { Instance.Min = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LimitTokenCountTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LimitTokenCountTokenFilter.g.cs index e5217c43d4..16f554c3d1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LimitTokenCountTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LimitTokenCountTokenFilter.g.cs @@ -107,7 +107,18 @@ internal LimitTokenCountTokenFilter(Elastic.Clients.Elasticsearch.Serialization. _ = sentinel; } + /// + /// + /// If true, the limit filter exhausts the token stream, even if the max_token_count has already been reached. Defaults to false. + /// + /// public bool? ConsumeAllTokens { get; set; } + + /// + /// + /// Maximum number of tokens to keep. Once this limit is reached, any remaining tokens are excluded from the output. Defaults to 1. + /// + /// public int? MaxTokenCount { get; set; } public string Type => "limit"; @@ -134,12 +145,22 @@ public LimitTokenCountTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.LimitTokenCountTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.LimitTokenCountTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.LimitTokenCountTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.LimitTokenCountTokenFilter(Elastic.Clients.Elasticsearch.Analysis.LimitTokenCountTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// If true, the limit filter exhausts the token stream, even if the max_token_count has already been reached. Defaults to false. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.LimitTokenCountTokenFilterDescriptor ConsumeAllTokens(bool? value = true) { Instance.ConsumeAllTokens = value; return this; } + /// + /// + /// Maximum number of tokens to keep. Once this limit is reached, any remaining tokens are excluded from the output. Defaults to 1. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.LimitTokenCountTokenFilterDescriptor MaxTokenCount(int? value) { Instance.MaxTokenCount = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LithuanianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LithuanianAnalyzer.g.cs index 5285aa6d1a..b1f0329993 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LithuanianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LithuanianAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.LithuanianAnalyzer Read(r { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.LithuanianAnalyzer Read(r continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal LithuanianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonCons } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "lithuanian"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.LithuanianAnalyzerDescriptor StemE return this; } - public Elastic.Clients.Elasticsearch.Analysis.LithuanianAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.LithuanianAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.LithuanianAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.LithuanianAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenFilter.g.cs index 786b166ab9..3a45e7bd8c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/LowercaseTokenFilter.g.cs @@ -32,7 +32,7 @@ internal sealed partial class LowercaseTokenFilterConverter : System.Text.Json.S public override Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propLanguage = default; + LocalJsonValue propLanguage = default; LocalJsonValue propVersion = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -98,7 +98,12 @@ internal LowercaseTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonCo _ = sentinel; } - public string? Language { get; set; } + /// + /// + /// Language-specific lowercase token filter to use. + /// + /// + public Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages? Language { get; set; } public string Type => "lowercase"; @@ -124,7 +129,12 @@ public LowercaseTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilter(Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterDescriptor descriptor) => descriptor.Instance; - public Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterDescriptor Language(string? value) + /// + /// + /// Language-specific lowercase token filter to use. + /// + /// + public Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterDescriptor Language(Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages? value) { Instance.Language = value; return this; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MinHashTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MinHashTokenFilter.g.cs new file mode 100644 index 0000000000..84d3f114e6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MinHashTokenFilter.g.cs @@ -0,0 +1,244 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +internal sealed partial class MinHashTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBucketCount = System.Text.Json.JsonEncodedText.Encode("bucket_count"); + private static readonly System.Text.Json.JsonEncodedText PropHashCount = System.Text.Json.JsonEncodedText.Encode("hash_count"); + private static readonly System.Text.Json.JsonEncodedText PropHashSetSize = System.Text.Json.JsonEncodedText.Encode("hash_set_size"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + private static readonly System.Text.Json.JsonEncodedText PropWithRotation = System.Text.Json.JsonEncodedText.Encode("with_rotation"); + + public override Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBucketCount = default; + LocalJsonValue propHashCount = default; + LocalJsonValue propHashSetSize = default; + LocalJsonValue propVersion = default; + LocalJsonValue propWithRotation = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBucketCount.TryReadProperty(ref reader, options, PropBucketCount, null)) + { + continue; + } + + if (propHashCount.TryReadProperty(ref reader, options, PropHashCount, null)) + { + continue; + } + + if (propHashSetSize.TryReadProperty(ref reader, options, PropHashSetSize, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (propWithRotation.TryReadProperty(ref reader, options, PropWithRotation, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BucketCount = propBucketCount.Value, + HashCount = propHashCount.Value, + HashSetSize = propHashSetSize.Value, + Version = propVersion.Value, + WithRotation = propWithRotation.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBucketCount, value.BucketCount, null, null); + writer.WriteProperty(options, PropHashCount, value.HashCount, null, null); + writer.WriteProperty(options, PropHashSetSize, value.HashSetSize, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteProperty(options, PropWithRotation, value.WithRotation, null, null); + writer.WriteEndObject(); + } +} + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilterConverter))] +public sealed partial class MinHashTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter +{ +#if NET7_0_OR_GREATER + public MinHashTokenFilter() + { + } +#endif +#if !NET7_0_OR_GREATER + public MinHashTokenFilter() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal MinHashTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// Number of buckets to which hashes are assigned. Defaults to 512. + /// + /// + public int? BucketCount { get; set; } + + /// + /// + /// Number of ways to hash each token in the stream. Defaults to 1. + /// + /// + public int? HashCount { get; set; } + + /// + /// + /// Number of hashes to keep from each bucket. Defaults to 1. + /// Hashes are retained by ascending size, starting with the bucket’s smallest hash first. + /// + /// + public int? HashSetSize { get; set; } + + public string Type => "min_hash"; + + public string? Version { get; set; } + + /// + /// + /// If true, the filter fills empty buckets with the value of the first non-empty bucket to its circular right if the hash_set_size is 1. If the bucket_count argument is greater than 1, this parameter defaults to true. Otherwise, this parameter defaults to false. + /// + /// + public bool? WithRotation { get; set; } +} + +public readonly partial struct MinHashTokenFilterDescriptor +{ + internal Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilter Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public MinHashTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilter instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public MinHashTokenFilterDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilterDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilter(Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilterDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// Number of buckets to which hashes are assigned. Defaults to 512. + /// + /// + public Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilterDescriptor BucketCount(int? value) + { + Instance.BucketCount = value; + return this; + } + + /// + /// + /// Number of ways to hash each token in the stream. Defaults to 1. + /// + /// + public Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilterDescriptor HashCount(int? value) + { + Instance.HashCount = value; + return this; + } + + /// + /// + /// Number of hashes to keep from each bucket. Defaults to 1. + /// Hashes are retained by ascending size, starting with the bucket’s smallest hash first. + /// + /// + public Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilterDescriptor HashSetSize(int? value) + { + Instance.HashSetSize = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilterDescriptor Version(string? value) + { + Instance.Version = value; + return this; + } + + /// + /// + /// If true, the filter fills empty buckets with the value of the first non-empty bucket to its circular right if the hash_set_size is 1. If the bucket_count argument is greater than 1, this parameter defaults to true. Otherwise, this parameter defaults to false. + /// + /// + public Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilterDescriptor WithRotation(bool? value = true) + { + Instance.WithRotation = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilter Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilterDescriptor(new Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MultiplexerTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MultiplexerTokenFilter.g.cs index c0ba2f72c7..f6de941751 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MultiplexerTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/MultiplexerTokenFilter.g.cs @@ -113,11 +113,22 @@ internal MultiplexerTokenFilter(Elastic.Clients.Elasticsearch.Serialization.Json _ = sentinel; } + /// + /// + /// A list of token filters to apply to incoming tokens. + /// + /// public #if NET7_0_OR_GREATER required #endif System.Collections.Generic.ICollection Filters { get; set; } + + /// + /// + /// If true (the default) then emit the original token in addition to the filtered tokens. + /// + /// public bool? PreserveOriginal { get; set; } public string Type => "multiplexer"; @@ -144,18 +155,33 @@ public MultiplexerTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.MultiplexerTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.MultiplexerTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.MultiplexerTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.MultiplexerTokenFilter(Elastic.Clients.Elasticsearch.Analysis.MultiplexerTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// A list of token filters to apply to incoming tokens. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.MultiplexerTokenFilterDescriptor Filters(System.Collections.Generic.ICollection value) { Instance.Filters = value; return this; } + /// + /// + /// A list of token filters to apply to incoming tokens. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.MultiplexerTokenFilterDescriptor Filters(params string[] values) { Instance.Filters = [.. values]; return this; } + /// + /// + /// If true (the default) then emit the original token in addition to the filtered tokens. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.MultiplexerTokenFilterDescriptor PreserveOriginal(bool? value = true) { Instance.PreserveOriginal = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenFilter.g.cs index 0b397424eb..3d096520d2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NGramTokenFilter.g.cs @@ -116,8 +116,25 @@ internal NGramTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstr _ = sentinel; } + /// + /// + /// Maximum length of characters in a gram. Defaults to 2. + /// + /// public int? MaxGram { get; set; } + + /// + /// + /// Minimum length of characters in a gram. Defaults to 1. + /// + /// public int? MinGram { get; set; } + + /// + /// + /// Emits original token when set to true. Defaults to false. + /// + /// public bool? PreserveOriginal { get; set; } public string Type => "ngram"; @@ -144,18 +161,33 @@ public NGramTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.NGramTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.NGramTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.NGramTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.NGramTokenFilter(Elastic.Clients.Elasticsearch.Analysis.NGramTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// Maximum length of characters in a gram. Defaults to 2. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.NGramTokenFilterDescriptor MaxGram(int? value) { Instance.MaxGram = value; return this; } + /// + /// + /// Minimum length of characters in a gram. Defaults to 1. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.NGramTokenFilterDescriptor MinGram(int? value) { Instance.MinGram = value; return this; } + /// + /// + /// Emits original token when set to true. Defaults to false. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.NGramTokenFilterDescriptor PreserveOriginal(bool? value = true) { Instance.PreserveOriginal = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriPartOfSpeechTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriPartOfSpeechTokenFilter.g.cs index 77948affb8..4a2f9a75e5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriPartOfSpeechTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NoriPartOfSpeechTokenFilter.g.cs @@ -98,6 +98,11 @@ internal NoriPartOfSpeechTokenFilter(Elastic.Clients.Elasticsearch.Serialization _ = sentinel; } + /// + /// + /// An array of part-of-speech tags that should be removed. + /// + /// public System.Collections.Generic.ICollection? Stoptags { get; set; } public string Type => "nori_part_of_speech"; @@ -124,12 +129,22 @@ public NoriPartOfSpeechTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.NoriPartOfSpeechTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.NoriPartOfSpeechTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.NoriPartOfSpeechTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.NoriPartOfSpeechTokenFilter(Elastic.Clients.Elasticsearch.Analysis.NoriPartOfSpeechTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// An array of part-of-speech tags that should be removed. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.NoriPartOfSpeechTokenFilterDescriptor Stoptags(System.Collections.Generic.ICollection? value) { Instance.Stoptags = value; return this; } + /// + /// + /// An array of part-of-speech tags that should be removed. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.NoriPartOfSpeechTokenFilterDescriptor Stoptags(params string[] values) { Instance.Stoptags = [.. values]; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NorwegianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NorwegianAnalyzer.g.cs index 795524fcea..f2db3bead9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NorwegianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/NorwegianAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.NorwegianAnalyzer Read(re { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.NorwegianAnalyzer Read(re continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal NorwegianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConst } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "norwegian"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.NorwegianAnalyzerDescriptor StemEx return this; } - public Elastic.Clients.Elasticsearch.Analysis.NorwegianAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.NorwegianAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.NorwegianAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.NorwegianAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternAnalyzer.g.cs index 07e94ec3ae..019ba4d03b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternAnalyzer.g.cs @@ -39,7 +39,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.PatternAnalyzer Read(ref LocalJsonValue propFlags = default; LocalJsonValue propLowercase = default; LocalJsonValue propPattern = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; LocalJsonValue propVersion = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) @@ -59,7 +59,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.PatternAnalyzer Read(ref continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -109,7 +109,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropFlags, value.Flags, null, null); writer.WriteProperty(options, PropLowercase, value.Lowercase, null, null); writer.WriteProperty(options, PropPattern, value.Pattern, null, null); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); #pragma warning disable CS0618 @@ -168,7 +168,7 @@ internal PatternAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstru /// Defaults to _none_. /// /// - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } /// /// @@ -243,24 +243,12 @@ public Elastic.Clients.Elasticsearch.Analysis.PatternAnalyzerDescriptor Pattern( /// Defaults to _none_. /// /// - public Elastic.Clients.Elasticsearch.Analysis.PatternAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.PatternAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - /// - /// - /// A pre-defined stop words list like _english_ or an array containing a list of stop words. - /// Defaults to _none_. - /// - /// - public Elastic.Clients.Elasticsearch.Analysis.PatternAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - /// /// /// The path to a file containing stop words. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternCaptureTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternCaptureTokenFilter.g.cs index 000e014bc9..37b76d4318 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternCaptureTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternCaptureTokenFilter.g.cs @@ -113,11 +113,22 @@ internal PatternCaptureTokenFilter(Elastic.Clients.Elasticsearch.Serialization.J _ = sentinel; } + /// + /// + /// A list of regular expressions to match. + /// + /// public #if NET7_0_OR_GREATER required #endif System.Collections.Generic.ICollection Patterns { get; set; } + + /// + /// + /// If set to true (the default) it will emit the original token. + /// + /// public bool? PreserveOriginal { get; set; } public string Type => "pattern_capture"; @@ -144,18 +155,33 @@ public PatternCaptureTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.PatternCaptureTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.PatternCaptureTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.PatternCaptureTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.PatternCaptureTokenFilter(Elastic.Clients.Elasticsearch.Analysis.PatternCaptureTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// A list of regular expressions to match. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.PatternCaptureTokenFilterDescriptor Patterns(System.Collections.Generic.ICollection value) { Instance.Patterns = value; return this; } + /// + /// + /// A list of regular expressions to match. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.PatternCaptureTokenFilterDescriptor Patterns(params string[] values) { Instance.Patterns = [.. values]; return this; } + /// + /// + /// If set to true (the default) it will emit the original token. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.PatternCaptureTokenFilterDescriptor PreserveOriginal(bool? value = true) { Instance.PreserveOriginal = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternReplaceTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternReplaceTokenFilter.g.cs index 9b0a47320e..8ce0db5662 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternReplaceTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PatternReplaceTokenFilter.g.cs @@ -26,7 +26,6 @@ namespace Elastic.Clients.Elasticsearch.Analysis; internal sealed partial class PatternReplaceTokenFilterConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropAll = System.Text.Json.JsonEncodedText.Encode("all"); - private static readonly System.Text.Json.JsonEncodedText PropFlags = System.Text.Json.JsonEncodedText.Encode("flags"); private static readonly System.Text.Json.JsonEncodedText PropPattern = System.Text.Json.JsonEncodedText.Encode("pattern"); private static readonly System.Text.Json.JsonEncodedText PropReplacement = System.Text.Json.JsonEncodedText.Encode("replacement"); private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); @@ -36,7 +35,6 @@ public override Elastic.Clients.Elasticsearch.Analysis.PatternReplaceTokenFilter { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propAll = default; - LocalJsonValue propFlags = default; LocalJsonValue propPattern = default; LocalJsonValue propReplacement = default; LocalJsonValue propVersion = default; @@ -47,11 +45,6 @@ public override Elastic.Clients.Elasticsearch.Analysis.PatternReplaceTokenFilter continue; } - if (propFlags.TryReadProperty(ref reader, options, PropFlags, null)) - { - continue; - } - if (propPattern.TryReadProperty(ref reader, options, PropPattern, null)) { continue; @@ -86,7 +79,6 @@ public override Elastic.Clients.Elasticsearch.Analysis.PatternReplaceTokenFilter return new Elastic.Clients.Elasticsearch.Analysis.PatternReplaceTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { All = propAll.Value, - Flags = propFlags.Value, Pattern = propPattern.Value, Replacement = propReplacement.Value, Version = propVersion.Value @@ -97,7 +89,6 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropAll, value.All, null, null); - writer.WriteProperty(options, PropFlags, value.Flags, null, null); writer.WriteProperty(options, PropPattern, value.Pattern, null, null); writer.WriteProperty(options, PropReplacement, value.Replacement, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); @@ -131,13 +122,29 @@ internal PatternReplaceTokenFilter(Elastic.Clients.Elasticsearch.Serialization.J _ = sentinel; } + /// + /// + /// If true, all substrings matching the pattern parameter’s regular expression are replaced. If false, the filter replaces only the first matching substring in each token. Defaults to true. + /// + /// public bool? All { get; set; } - public string? Flags { get; set; } + + /// + /// + /// Regular expression, written in Java’s regular expression syntax. The filter replaces token substrings matching this pattern with the substring in the replacement parameter. + /// + /// public #if NET7_0_OR_GREATER required #endif string Pattern { get; set; } + + /// + /// + /// Replacement substring. Defaults to an empty substring (""). + /// + /// public string? Replacement { get; set; } public string Type => "pattern_replace"; @@ -164,24 +171,33 @@ public PatternReplaceTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.PatternReplaceTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.PatternReplaceTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.PatternReplaceTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.PatternReplaceTokenFilter(Elastic.Clients.Elasticsearch.Analysis.PatternReplaceTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// If true, all substrings matching the pattern parameter’s regular expression are replaced. If false, the filter replaces only the first matching substring in each token. Defaults to true. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.PatternReplaceTokenFilterDescriptor All(bool? value = true) { Instance.All = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.PatternReplaceTokenFilterDescriptor Flags(string? value) - { - Instance.Flags = value; - return this; - } - + /// + /// + /// Regular expression, written in Java’s regular expression syntax. The filter replaces token substrings matching this pattern with the substring in the replacement parameter. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.PatternReplaceTokenFilterDescriptor Pattern(string value) { Instance.Pattern = value; return this; } + /// + /// + /// Replacement substring. Defaults to an empty substring (""). + /// + /// public Elastic.Clients.Elasticsearch.Analysis.PatternReplaceTokenFilterDescriptor Replacement(string? value) { Instance.Replacement = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianAnalyzer.g.cs index cefa200067..37d2add67a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianAnalyzer.g.cs @@ -32,11 +32,11 @@ internal sealed partial class PersianAnalyzerConverter : System.Text.Json.Serial public override Elastic.Clients.Elasticsearch.Analysis.PersianAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -72,7 +72,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.PersianAnalyzer Read(ref public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PersianAnalyzer value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -98,7 +98,7 @@ internal PersianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstru _ = sentinel; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "persian"; @@ -123,18 +123,12 @@ public PersianAnalyzerDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.PersianAnalyzerDescriptor(Elastic.Clients.Elasticsearch.Analysis.PersianAnalyzer instance) => new Elastic.Clients.Elasticsearch.Analysis.PersianAnalyzerDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.PersianAnalyzer(Elastic.Clients.Elasticsearch.Analysis.PersianAnalyzerDescriptor descriptor) => descriptor.Instance; - public Elastic.Clients.Elasticsearch.Analysis.PersianAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.PersianAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.PersianAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.PersianAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianNormalizationTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianNormalizationTokenFilter.g.cs new file mode 100644 index 0000000000..e273787b1b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PersianNormalizationTokenFilter.g.cs @@ -0,0 +1,134 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +internal sealed partial class PersianNormalizationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilterConverter))] +public sealed partial class PersianNormalizationTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter +{ +#if NET7_0_OR_GREATER + public PersianNormalizationTokenFilter() + { + } +#endif +#if !NET7_0_OR_GREATER + public PersianNormalizationTokenFilter() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal PersianNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public string Type => "persian_normalization"; + + public string? Version { get; set; } +} + +public readonly partial struct PersianNormalizationTokenFilterDescriptor +{ + internal Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilter Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public PersianNormalizationTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilter instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public PersianNormalizationTokenFilterDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilterDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilterDescriptor descriptor) => descriptor.Instance; + + public Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilterDescriptor Version(string? value) + { + Instance.Version = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilter Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilterDescriptor(new Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PortugueseAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PortugueseAnalyzer.g.cs index 9e6ddac52d..c9f24c432b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PortugueseAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PortugueseAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.PortugueseAnalyzer Read(r { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.PortugueseAnalyzer Read(r continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal PortugueseAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonCons } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "portuguese"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.PortugueseAnalyzerDescriptor StemE return this; } - public Elastic.Clients.Elasticsearch.Analysis.PortugueseAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.PortugueseAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.PortugueseAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.PortugueseAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PredicateTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PredicateTokenFilter.g.cs index 0459fff7e5..06a8296c0b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PredicateTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/PredicateTokenFilter.g.cs @@ -104,6 +104,11 @@ internal PredicateTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonCo _ = sentinel; } + /// + /// + /// Script containing a condition used to filter incoming tokens. Only tokens that match this script are included in the output. + /// + /// public #if NET7_0_OR_GREATER required @@ -134,18 +139,33 @@ public PredicateTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.PredicateTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.PredicateTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.PredicateTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.PredicateTokenFilter(Elastic.Clients.Elasticsearch.Analysis.PredicateTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// Script containing a condition used to filter incoming tokens. Only tokens that match this script are included in the output. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.PredicateTokenFilterDescriptor Script(Elastic.Clients.Elasticsearch.Script value) { Instance.Script = value; return this; } + /// + /// + /// Script containing a condition used to filter incoming tokens. Only tokens that match this script are included in the output. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.PredicateTokenFilterDescriptor Script() { Instance.Script = Elastic.Clients.Elasticsearch.ScriptDescriptor.Build(null); return this; } + /// + /// + /// Script containing a condition used to filter incoming tokens. Only tokens that match this script are included in the output. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.PredicateTokenFilterDescriptor Script(System.Action? action) { Instance.Script = Elastic.Clients.Elasticsearch.ScriptDescriptor.Build(action); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RomanianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RomanianAnalyzer.g.cs index 17ec6eb815..bbf46773b9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RomanianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RomanianAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.RomanianAnalyzer Read(ref { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.RomanianAnalyzer Read(ref continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal RomanianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstr } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "romanian"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.RomanianAnalyzerDescriptor StemExc return this; } - public Elastic.Clients.Elasticsearch.Analysis.RomanianAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.RomanianAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.RomanianAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.RomanianAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RussianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RussianAnalyzer.g.cs index fdd1df6f18..4f1ab97e99 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RussianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/RussianAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.RussianAnalyzer Read(ref { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.RussianAnalyzer Read(ref continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal RussianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstru } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "russian"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.RussianAnalyzerDescriptor StemExcl return this; } - public Elastic.Clients.Elasticsearch.Analysis.RussianAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.RussianAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.RussianAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.RussianAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ScandinavianFoldingTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ScandinavianFoldingTokenFilter.g.cs new file mode 100644 index 0000000000..ccfef8c624 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ScandinavianFoldingTokenFilter.g.cs @@ -0,0 +1,134 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +internal sealed partial class ScandinavianFoldingTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilterConverter))] +public sealed partial class ScandinavianFoldingTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter +{ +#if NET7_0_OR_GREATER + public ScandinavianFoldingTokenFilter() + { + } +#endif +#if !NET7_0_OR_GREATER + public ScandinavianFoldingTokenFilter() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal ScandinavianFoldingTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public string Type => "scandinavian_folding"; + + public string? Version { get; set; } +} + +public readonly partial struct ScandinavianFoldingTokenFilterDescriptor +{ + internal Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilter Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ScandinavianFoldingTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilter instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ScandinavianFoldingTokenFilterDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilterDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilter(Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilterDescriptor descriptor) => descriptor.Instance; + + public Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilterDescriptor Version(string? value) + { + Instance.Version = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilter Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilterDescriptor(new Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ScandinavianNormalizationTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ScandinavianNormalizationTokenFilter.g.cs new file mode 100644 index 0000000000..5d3db13953 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ScandinavianNormalizationTokenFilter.g.cs @@ -0,0 +1,134 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +internal sealed partial class ScandinavianNormalizationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilterConverter))] +public sealed partial class ScandinavianNormalizationTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter +{ +#if NET7_0_OR_GREATER + public ScandinavianNormalizationTokenFilter() + { + } +#endif +#if !NET7_0_OR_GREATER + public ScandinavianNormalizationTokenFilter() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal ScandinavianNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public string Type => "scandinavian_normalization"; + + public string? Version { get; set; } +} + +public readonly partial struct ScandinavianNormalizationTokenFilterDescriptor +{ + internal Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilter Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ScandinavianNormalizationTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilter instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ScandinavianNormalizationTokenFilterDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilterDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilterDescriptor descriptor) => descriptor.Instance; + + public Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilterDescriptor Version(string? value) + { + Instance.Version = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilter Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilterDescriptor(new Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SerbianAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SerbianAnalyzer.g.cs index 7c5943913c..cf3dee0335 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SerbianAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SerbianAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.SerbianAnalyzer Read(ref { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.SerbianAnalyzer Read(ref continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal SerbianAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstru } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "serbian"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.SerbianAnalyzerDescriptor StemExcl return this; } - public Elastic.Clients.Elasticsearch.Analysis.SerbianAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.SerbianAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.SerbianAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.SerbianAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SerbianNormalizationTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SerbianNormalizationTokenFilter.g.cs new file mode 100644 index 0000000000..b4396e1726 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SerbianNormalizationTokenFilter.g.cs @@ -0,0 +1,134 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +internal sealed partial class SerbianNormalizationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilterConverter))] +public sealed partial class SerbianNormalizationTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter +{ +#if NET7_0_OR_GREATER + public SerbianNormalizationTokenFilter() + { + } +#endif +#if !NET7_0_OR_GREATER + public SerbianNormalizationTokenFilter() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal SerbianNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public string Type => "serbian_normalization"; + + public string? Version { get; set; } +} + +public readonly partial struct SerbianNormalizationTokenFilterDescriptor +{ + internal Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilter Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public SerbianNormalizationTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilter instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public SerbianNormalizationTokenFilterDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilterDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilterDescriptor descriptor) => descriptor.Instance; + + public Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilterDescriptor Version(string? value) + { + Instance.Version = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilter Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilterDescriptor(new Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ShingleTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ShingleTokenFilter.g.cs index eb70093e57..5ce685f053 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ShingleTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ShingleTokenFilter.g.cs @@ -38,8 +38,8 @@ public override Elastic.Clients.Elasticsearch.Analysis.ShingleTokenFilter Read(r { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propFillerToken = default; - LocalJsonValue?> propMaxShingleSize = default; - LocalJsonValue?> propMinShingleSize = default; + LocalJsonValue propMaxShingleSize = default; + LocalJsonValue propMinShingleSize = default; LocalJsonValue propOutputUnigrams = default; LocalJsonValue propOutputUnigramsIfNoShingles = default; LocalJsonValue propTokenSeparator = default; @@ -51,12 +51,12 @@ public override Elastic.Clients.Elasticsearch.Analysis.ShingleTokenFilter Read(r continue; } - if (propMaxShingleSize.TryReadProperty(ref reader, options, PropMaxShingleSize, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) + if (propMaxShingleSize.TryReadProperty(ref reader, options, PropMaxShingleSize, null)) { continue; } - if (propMinShingleSize.TryReadProperty(ref reader, options, PropMinShingleSize, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.Number, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String), null, null))) + if (propMinShingleSize.TryReadProperty(ref reader, options, PropMinShingleSize, null)) { continue; } @@ -113,8 +113,8 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropFillerToken, value.FillerToken, null, null); - writer.WriteProperty(options, PropMaxShingleSize, value.MaxShingleSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); - writer.WriteProperty(options, PropMinShingleSize, value.MinShingleSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); + writer.WriteProperty(options, PropMaxShingleSize, value.MaxShingleSize, null, null); + writer.WriteProperty(options, PropMinShingleSize, value.MinShingleSize, null, null); writer.WriteProperty(options, PropOutputUnigrams, value.OutputUnigrams, null, null); writer.WriteProperty(options, PropOutputUnigramsIfNoShingles, value.OutputUnigramsIfNoShingles, null, null); writer.WriteProperty(options, PropTokenSeparator, value.TokenSeparator, null, null); @@ -143,11 +143,46 @@ internal ShingleTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonCons _ = sentinel; } + /// + /// + /// String used in shingles as a replacement for empty positions that do not contain a token. This filler token is only used in shingles, not original unigrams. Defaults to an underscore (_). + /// + /// public string? FillerToken { get; set; } - public Elastic.Clients.Elasticsearch.Union? MaxShingleSize { get; set; } - public Elastic.Clients.Elasticsearch.Union? MinShingleSize { get; set; } + + /// + /// + /// Maximum number of tokens to concatenate when creating shingles. Defaults to 2. + /// + /// + public int? MaxShingleSize { get; set; } + + /// + /// + /// Minimum number of tokens to concatenate when creating shingles. Defaults to 2. + /// + /// + public int? MinShingleSize { get; set; } + + /// + /// + /// If true, the output includes the original input tokens. If false, the output only includes shingles; the original input tokens are removed. Defaults to true. + /// + /// public bool? OutputUnigrams { get; set; } + + /// + /// + /// If true, the output includes the original input tokens only if no shingles are produced; if shingles are produced, the output only includes shingles. Defaults to false. + /// + /// public bool? OutputUnigramsIfNoShingles { get; set; } + + /// + /// + /// Separator used to concatenate adjacent tokens to form a shingle. Defaults to a space (" "). + /// + /// public string? TokenSeparator { get; set; } public string Type => "shingle"; @@ -174,36 +209,66 @@ public ShingleTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.ShingleTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.ShingleTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.ShingleTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.ShingleTokenFilter(Elastic.Clients.Elasticsearch.Analysis.ShingleTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// String used in shingles as a replacement for empty positions that do not contain a token. This filler token is only used in shingles, not original unigrams. Defaults to an underscore (_). + /// + /// public Elastic.Clients.Elasticsearch.Analysis.ShingleTokenFilterDescriptor FillerToken(string? value) { Instance.FillerToken = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.ShingleTokenFilterDescriptor MaxShingleSize(Elastic.Clients.Elasticsearch.Union? value) + /// + /// + /// Maximum number of tokens to concatenate when creating shingles. Defaults to 2. + /// + /// + public Elastic.Clients.Elasticsearch.Analysis.ShingleTokenFilterDescriptor MaxShingleSize(int? value) { Instance.MaxShingleSize = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.ShingleTokenFilterDescriptor MinShingleSize(Elastic.Clients.Elasticsearch.Union? value) + /// + /// + /// Minimum number of tokens to concatenate when creating shingles. Defaults to 2. + /// + /// + public Elastic.Clients.Elasticsearch.Analysis.ShingleTokenFilterDescriptor MinShingleSize(int? value) { Instance.MinShingleSize = value; return this; } + /// + /// + /// If true, the output includes the original input tokens. If false, the output only includes shingles; the original input tokens are removed. Defaults to true. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.ShingleTokenFilterDescriptor OutputUnigrams(bool? value = true) { Instance.OutputUnigrams = value; return this; } + /// + /// + /// If true, the output includes the original input tokens only if no shingles are produced; if shingles are produced, the output only includes shingles. Defaults to false. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.ShingleTokenFilterDescriptor OutputUnigramsIfNoShingles(bool? value = true) { Instance.OutputUnigramsIfNoShingles = value; return this; } + /// + /// + /// Separator used to concatenate adjacent tokens to form a shingle. Defaults to a space (" "). + /// + /// public Elastic.Clients.Elasticsearch.Analysis.ShingleTokenFilterDescriptor TokenSeparator(string? value) { Instance.TokenSeparator = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballAnalyzer.g.cs index 498f409622..e867ad9845 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.SnowballAnalyzer Read(ref { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propLanguage = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propVersion = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.SnowballAnalyzer Read(ref continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -83,7 +83,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropLanguage, value.Language, null, null); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropType, value.Type, null, null); #pragma warning disable CS0618 writer.WriteProperty(options, PropVersion, value.Version, null, null) @@ -123,7 +123,7 @@ internal SnowballAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstr required #endif Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage Language { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string Type => "snowball"; @@ -156,18 +156,12 @@ public Elastic.Clients.Elasticsearch.Analysis.SnowballAnalyzerDescriptor Languag return this; } - public Elastic.Clients.Elasticsearch.Analysis.SnowballAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.SnowballAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.SnowballAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - [System.Obsolete("Deprecated in '7.14.0'.")] public Elastic.Clients.Elasticsearch.Analysis.SnowballAnalyzerDescriptor Version(string? value) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballTokenFilter.g.cs index 02de596615..be3361dda5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SnowballTokenFilter.g.cs @@ -98,6 +98,11 @@ internal SnowballTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonCon _ = sentinel; } + /// + /// + /// Controls the language used by the stemmer. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage? Language { get; set; } public string Type => "snowball"; @@ -124,6 +129,11 @@ public SnowballTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.SnowballTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.SnowballTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.SnowballTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.SnowballTokenFilter(Elastic.Clients.Elasticsearch.Analysis.SnowballTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// Controls the language used by the stemmer. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.SnowballTokenFilterDescriptor Language(Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage? value) { Instance.Language = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SoraniAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SoraniAnalyzer.g.cs index b6e3369756..0e102f02c2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SoraniAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SoraniAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.SoraniAnalyzer Read(ref S { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.SoraniAnalyzer Read(ref S continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal SoraniAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstruc } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "sorani"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.SoraniAnalyzerDescriptor StemExclu return this; } - public Elastic.Clients.Elasticsearch.Analysis.SoraniAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.SoraniAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.SoraniAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.SoraniAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SoraniNormalizationTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SoraniNormalizationTokenFilter.g.cs new file mode 100644 index 0000000000..8ed49808a1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SoraniNormalizationTokenFilter.g.cs @@ -0,0 +1,134 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Analysis; + +internal sealed partial class SoraniNormalizationTokenFilterConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilter Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(PropType)) + { + reader.Skip(); + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilter value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, null); + writer.WriteEndObject(); + } +} + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilterConverter))] +public sealed partial class SoraniNormalizationTokenFilter : Elastic.Clients.Elasticsearch.Analysis.ITokenFilter +{ +#if NET7_0_OR_GREATER + public SoraniNormalizationTokenFilter() + { + } +#endif +#if !NET7_0_OR_GREATER + public SoraniNormalizationTokenFilter() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal SoraniNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public string Type => "sorani_normalization"; + + public string? Version { get; set; } +} + +public readonly partial struct SoraniNormalizationTokenFilterDescriptor +{ + internal Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilter Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public SoraniNormalizationTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilter instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public SoraniNormalizationTokenFilterDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilterDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilterDescriptor descriptor) => descriptor.Instance; + + public Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilterDescriptor Version(string? value) + { + Instance.Version = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilter Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilterDescriptor(new Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SpanishAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SpanishAnalyzer.g.cs index 8c0100ea2c..a27a593d5a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SpanishAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SpanishAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.SpanishAnalyzer Read(ref { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.SpanishAnalyzer Read(ref continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal SpanishAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstru } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "spanish"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.SpanishAnalyzerDescriptor StemExcl return this; } - public Elastic.Clients.Elasticsearch.Analysis.SpanishAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.SpanishAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.SpanishAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.SpanishAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StandardAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StandardAnalyzer.g.cs index 46977284cb..b782712865 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StandardAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StandardAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.StandardAnalyzer Read(ref { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propMaxTokenLength = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.StandardAnalyzer Read(ref continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropMaxTokenLength, value.MaxTokenLength, null, null); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -121,7 +121,7 @@ internal StandardAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstr /// Defaults to _none_. /// /// - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } /// /// @@ -170,24 +170,12 @@ public Elastic.Clients.Elasticsearch.Analysis.StandardAnalyzerDescriptor MaxToke /// Defaults to _none_. /// /// - public Elastic.Clients.Elasticsearch.Analysis.StandardAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.StandardAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - /// - /// - /// A pre-defined stop words list like _english_ or an array containing a list of stop words. - /// Defaults to _none_. - /// - /// - public Elastic.Clients.Elasticsearch.Analysis.StandardAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - /// /// /// The path to a file containing stop words. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StemmerOverrideTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StemmerOverrideTokenFilter.g.cs index bb1ac0733f..cb5bd76537 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StemmerOverrideTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StemmerOverrideTokenFilter.g.cs @@ -107,7 +107,18 @@ internal StemmerOverrideTokenFilter(Elastic.Clients.Elasticsearch.Serialization. _ = sentinel; } + /// + /// + /// A list of mapping rules to use. + /// + /// public System.Collections.Generic.ICollection? Rules { get; set; } + + /// + /// + /// A path (either relative to config location, or absolute) to a list of mappings. + /// + /// public string? RulesPath { get; set; } public string Type => "stemmer_override"; @@ -134,18 +145,33 @@ public StemmerOverrideTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.StemmerOverrideTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.StemmerOverrideTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.StemmerOverrideTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.StemmerOverrideTokenFilter(Elastic.Clients.Elasticsearch.Analysis.StemmerOverrideTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// A list of mapping rules to use. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.StemmerOverrideTokenFilterDescriptor Rules(System.Collections.Generic.ICollection? value) { Instance.Rules = value; return this; } + /// + /// + /// A list of mapping rules to use. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.StemmerOverrideTokenFilterDescriptor Rules(params string[] values) { Instance.Rules = [.. values]; return this; } + /// + /// + /// A path (either relative to config location, or absolute) to a list of mappings. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.StemmerOverrideTokenFilterDescriptor RulesPath(string? value) { Instance.RulesPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopAnalyzer.g.cs index a6f8832d79..155fcaa4ab 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopAnalyzer.g.cs @@ -33,12 +33,12 @@ internal sealed partial class StopAnalyzerConverter : System.Text.Json.Serializa public override Elastic.Clients.Elasticsearch.Analysis.StopAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; LocalJsonValue propVersion = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -82,7 +82,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.StopAnalyzer Read(ref Sys public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.StopAnalyzer value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); #pragma warning disable CS0618 @@ -118,7 +118,7 @@ internal StopAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructo /// Defaults to _none_. /// /// - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } /// /// @@ -158,24 +158,12 @@ public StopAnalyzerDescriptor() /// Defaults to _none_. /// /// - public Elastic.Clients.Elasticsearch.Analysis.StopAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.StopAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - /// - /// - /// A pre-defined stop words list like _english_ or an array containing a list of stop words. - /// Defaults to _none_. - /// - /// - public Elastic.Clients.Elasticsearch.Analysis.StopAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - /// /// /// The path to a file containing stop words. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopTokenFilter.g.cs index 80e715ac6f..1343e571dd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/StopTokenFilter.g.cs @@ -37,7 +37,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.StopTokenFilter Read(ref reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propIgnoreCase = default; LocalJsonValue propRemoveTrailing = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; LocalJsonValue propVersion = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) @@ -52,7 +52,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.StopTokenFilter Read(ref continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -98,7 +98,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteStartObject(); writer.WriteProperty(options, PropIgnoreCase, value.IgnoreCase, null, null); writer.WriteProperty(options, PropRemoveTrailing, value.RemoveTrailing, null, null); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteProperty(options, PropVersion, value.Version, null, null); @@ -125,9 +125,33 @@ internal StopTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConstru _ = sentinel; } + /// + /// + /// If true, stop word matching is case insensitive. For example, if true, a stop word of the matches and removes The, THE, or the. Defaults to false. + /// + /// public bool? IgnoreCase { get; set; } + + /// + /// + /// If true, the last token of a stream is removed if it’s a stop word. Defaults to true. + /// + /// public bool? RemoveTrailing { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + + /// + /// + /// Language value, such as _arabic_ or _thai_. Defaults to _english_. + /// + /// + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } + + /// + /// + /// Path to a file that contains a list of stop words to remove. + /// This path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each stop word in the file must be separated by a line break. + /// + /// public string? StopwordsPath { get; set; } public string Type => "stop"; @@ -154,30 +178,45 @@ public StopTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.StopTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.StopTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.StopTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.StopTokenFilter(Elastic.Clients.Elasticsearch.Analysis.StopTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// If true, stop word matching is case insensitive. For example, if true, a stop word of the matches and removes The, THE, or the. Defaults to false. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.StopTokenFilterDescriptor IgnoreCase(bool? value = true) { Instance.IgnoreCase = value; return this; } + /// + /// + /// If true, the last token of a stream is removed if it’s a stop word. Defaults to true. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.StopTokenFilterDescriptor RemoveTrailing(bool? value = true) { Instance.RemoveTrailing = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.StopTokenFilterDescriptor Stopwords(System.Collections.Generic.ICollection? value) + /// + /// + /// Language value, such as _arabic_ or _thai_. Defaults to _english_. + /// + /// + public Elastic.Clients.Elasticsearch.Analysis.StopTokenFilterDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.StopTokenFilterDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - + /// + /// + /// Path to a file that contains a list of stop words to remove. + /// This path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each stop word in the file must be separated by a line break. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.StopTokenFilterDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SwedishAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SwedishAnalyzer.g.cs index 722ce09035..38a2cebbe0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SwedishAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SwedishAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.SwedishAnalyzer Read(ref { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.SwedishAnalyzer Read(ref continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal SwedishAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstru } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "swedish"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.SwedishAnalyzerDescriptor StemExcl return this; } - public Elastic.Clients.Elasticsearch.Analysis.SwedishAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.SwedishAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.SwedishAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.SwedishAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymGraphTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymGraphTokenFilter.g.cs index 3a1295e844..3a3635455d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymGraphTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymGraphTokenFilter.g.cs @@ -161,16 +161,62 @@ internal SynonymGraphTokenFilter(Elastic.Clients.Elasticsearch.Serialization.Jso _ = sentinel; } + /// + /// + /// Expands definitions for equivalent synonym rules. Defaults to true. + /// + /// public bool? Expand { get; set; } + + /// + /// + /// Sets the synonym rules format. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.SynonymFormat? Format { get; set; } + + /// + /// + /// If true ignores errors while parsing the synonym rules. It is important to note that only those synonym rules which cannot get parsed are ignored. Defaults to the value of the updateable setting. + /// + /// public bool? Lenient { get; set; } + + /// + /// + /// Used to define inline synonyms. + /// + /// public System.Collections.Generic.ICollection? Synonyms { get; set; } + + /// + /// + /// Used to provide a synonym file. This path must be absolute or relative to the config location. + /// + /// public string? SynonymsPath { get; set; } + + /// + /// + /// Provide a synonym set created via Synonyms Management APIs. + /// + /// public string? SynonymsSet { get; set; } + + /// + /// + /// Controls the tokenizers that will be used to tokenize the synonym, this parameter is for backwards compatibility for indices that created before 6.0. + /// + /// public string? Tokenizer { get; set; } public string Type => "synonym_graph"; + /// + /// + /// If true allows reloading search analyzers to pick up changes to synonym files. Only to be used for search analyzers. Defaults to false. + /// + /// public bool? Updateable { get; set; } public string? Version { get; set; } } @@ -194,54 +240,99 @@ public SynonymGraphTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.SynonymGraphTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.SynonymGraphTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.SynonymGraphTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.SynonymGraphTokenFilter(Elastic.Clients.Elasticsearch.Analysis.SynonymGraphTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// Expands definitions for equivalent synonym rules. Defaults to true. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.SynonymGraphTokenFilterDescriptor Expand(bool? value = true) { Instance.Expand = value; return this; } + /// + /// + /// Sets the synonym rules format. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.SynonymGraphTokenFilterDescriptor Format(Elastic.Clients.Elasticsearch.Analysis.SynonymFormat? value) { Instance.Format = value; return this; } + /// + /// + /// If true ignores errors while parsing the synonym rules. It is important to note that only those synonym rules which cannot get parsed are ignored. Defaults to the value of the updateable setting. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.SynonymGraphTokenFilterDescriptor Lenient(bool? value = true) { Instance.Lenient = value; return this; } + /// + /// + /// Used to define inline synonyms. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.SynonymGraphTokenFilterDescriptor Synonyms(System.Collections.Generic.ICollection? value) { Instance.Synonyms = value; return this; } + /// + /// + /// Used to define inline synonyms. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.SynonymGraphTokenFilterDescriptor Synonyms(params string[] values) { Instance.Synonyms = [.. values]; return this; } + /// + /// + /// Used to provide a synonym file. This path must be absolute or relative to the config location. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.SynonymGraphTokenFilterDescriptor SynonymsPath(string? value) { Instance.SynonymsPath = value; return this; } + /// + /// + /// Provide a synonym set created via Synonyms Management APIs. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.SynonymGraphTokenFilterDescriptor SynonymsSet(string? value) { Instance.SynonymsSet = value; return this; } + /// + /// + /// Controls the tokenizers that will be used to tokenize the synonym, this parameter is for backwards compatibility for indices that created before 6.0. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.SynonymGraphTokenFilterDescriptor Tokenizer(string? value) { Instance.Tokenizer = value; return this; } + /// + /// + /// If true allows reloading search analyzers to pick up changes to synonym files. Only to be used for search analyzers. Defaults to false. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.SynonymGraphTokenFilterDescriptor Updateable(bool? value = true) { Instance.Updateable = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymTokenFilter.g.cs index 20dfc4a649..39a058feec 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/SynonymTokenFilter.g.cs @@ -161,16 +161,62 @@ internal SynonymTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonCons _ = sentinel; } + /// + /// + /// Expands definitions for equivalent synonym rules. Defaults to true. + /// + /// public bool? Expand { get; set; } + + /// + /// + /// Sets the synonym rules format. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.SynonymFormat? Format { get; set; } + + /// + /// + /// If true ignores errors while parsing the synonym rules. It is important to note that only those synonym rules which cannot get parsed are ignored. Defaults to the value of the updateable setting. + /// + /// public bool? Lenient { get; set; } + + /// + /// + /// Used to define inline synonyms. + /// + /// public System.Collections.Generic.ICollection? Synonyms { get; set; } + + /// + /// + /// Used to provide a synonym file. This path must be absolute or relative to the config location. + /// + /// public string? SynonymsPath { get; set; } + + /// + /// + /// Provide a synonym set created via Synonyms Management APIs. + /// + /// public string? SynonymsSet { get; set; } + + /// + /// + /// Controls the tokenizers that will be used to tokenize the synonym, this parameter is for backwards compatibility for indices that created before 6.0. + /// + /// public string? Tokenizer { get; set; } public string Type => "synonym"; + /// + /// + /// If true allows reloading search analyzers to pick up changes to synonym files. Only to be used for search analyzers. Defaults to false. + /// + /// public bool? Updateable { get; set; } public string? Version { get; set; } } @@ -194,54 +240,99 @@ public SynonymTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.SynonymTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.SynonymTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.SynonymTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.SynonymTokenFilter(Elastic.Clients.Elasticsearch.Analysis.SynonymTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// Expands definitions for equivalent synonym rules. Defaults to true. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.SynonymTokenFilterDescriptor Expand(bool? value = true) { Instance.Expand = value; return this; } + /// + /// + /// Sets the synonym rules format. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.SynonymTokenFilterDescriptor Format(Elastic.Clients.Elasticsearch.Analysis.SynonymFormat? value) { Instance.Format = value; return this; } + /// + /// + /// If true ignores errors while parsing the synonym rules. It is important to note that only those synonym rules which cannot get parsed are ignored. Defaults to the value of the updateable setting. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.SynonymTokenFilterDescriptor Lenient(bool? value = true) { Instance.Lenient = value; return this; } + /// + /// + /// Used to define inline synonyms. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.SynonymTokenFilterDescriptor Synonyms(System.Collections.Generic.ICollection? value) { Instance.Synonyms = value; return this; } + /// + /// + /// Used to define inline synonyms. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.SynonymTokenFilterDescriptor Synonyms(params string[] values) { Instance.Synonyms = [.. values]; return this; } + /// + /// + /// Used to provide a synonym file. This path must be absolute or relative to the config location. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.SynonymTokenFilterDescriptor SynonymsPath(string? value) { Instance.SynonymsPath = value; return this; } + /// + /// + /// Provide a synonym set created via Synonyms Management APIs. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.SynonymTokenFilterDescriptor SynonymsSet(string? value) { Instance.SynonymsSet = value; return this; } + /// + /// + /// Controls the tokenizers that will be used to tokenize the synonym, this parameter is for backwards compatibility for indices that created before 6.0. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.SynonymTokenFilterDescriptor Tokenizer(string? value) { Instance.Tokenizer = value; return this; } + /// + /// + /// If true allows reloading search analyzers to pick up changes to synonym files. Only to be used for search analyzers. Defaults to false. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.SynonymTokenFilterDescriptor Updateable(bool? value = true) { Instance.Updateable = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ThaiAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ThaiAnalyzer.g.cs index f35191c1dc..45d72005cc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ThaiAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/ThaiAnalyzer.g.cs @@ -32,11 +32,11 @@ internal sealed partial class ThaiAnalyzerConverter : System.Text.Json.Serializa public override Elastic.Clients.Elasticsearch.Analysis.ThaiAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -72,7 +72,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.ThaiAnalyzer Read(ref Sys public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.ThaiAnalyzer value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -98,7 +98,7 @@ internal ThaiAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructo _ = sentinel; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "thai"; @@ -123,18 +123,12 @@ public ThaiAnalyzerDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.ThaiAnalyzerDescriptor(Elastic.Clients.Elasticsearch.Analysis.ThaiAnalyzer instance) => new Elastic.Clients.Elasticsearch.Analysis.ThaiAnalyzerDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.ThaiAnalyzer(Elastic.Clients.Elasticsearch.Analysis.ThaiAnalyzerDescriptor descriptor) => descriptor.Instance; - public Elastic.Clients.Elasticsearch.Analysis.ThaiAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.ThaiAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.ThaiAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.ThaiAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenFilter.g.cs index 31b3e07b0d..73da0d3460 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenFilter.g.cs @@ -45,23 +45,35 @@ public override Elastic.Clients.Elasticsearch.Analysis.ITokenFilter Read(ref Sys reader = readerSnapshot; return discriminator switch { + "apostrophe" => reader.ReadValue(options, null), + "arabic_normalization" => reader.ReadValue(options, null), "asciifolding" => reader.ReadValue(options, null), + "cjk_bigram" => reader.ReadValue(options, null), + "cjk_width" => reader.ReadValue(options, null), + "classic" => reader.ReadValue(options, null), "common_grams" => reader.ReadValue(options, null), "condition" => reader.ReadValue(options, null), + "decimal_digit" => reader.ReadValue(options, null), "delimited_payload" => reader.ReadValue(options, null), "dictionary_decompounder" => reader.ReadValue(options, null), "edge_ngram" => reader.ReadValue(options, null), "elision" => reader.ReadValue(options, null), "fingerprint" => reader.ReadValue(options, null), + "flatten_graph" => reader.ReadValue(options, null), + "german_normalization" => reader.ReadValue(options, null), + "hindi_normalization" => reader.ReadValue(options, null), "hunspell" => reader.ReadValue(options, null), "hyphenation_decompounder" => reader.ReadValue(options, null), "icu_collation" => reader.ReadValue(options, null), "icu_folding" => reader.ReadValue(options, null), "icu_normalizer" => reader.ReadValue(options, null), "icu_transform" => reader.ReadValue(options, null), + "indic_normalization" => reader.ReadValue(options, null), + "ja_stop" => reader.ReadValue(options, null), "keep" => reader.ReadValue(options, null), "keep_types" => reader.ReadValue(options, null), "keyword_marker" => reader.ReadValue(options, null), + "keyword_repeat" => reader.ReadValue(options, null), "kstem" => reader.ReadValue(options, null), "kuromoji_part_of_speech" => reader.ReadValue(options, null), "kuromoji_readingform" => reader.ReadValue(options, null), @@ -69,18 +81,24 @@ public override Elastic.Clients.Elasticsearch.Analysis.ITokenFilter Read(ref Sys "length" => reader.ReadValue(options, null), "limit" => reader.ReadValue(options, null), "lowercase" => reader.ReadValue(options, null), + "min_hash" => reader.ReadValue(options, null), "multiplexer" => reader.ReadValue(options, null), "ngram" => reader.ReadValue(options, null), "nori_part_of_speech" => reader.ReadValue(options, null), "pattern_capture" => reader.ReadValue(options, null), "pattern_replace" => reader.ReadValue(options, null), + "persian_normalization" => reader.ReadValue(options, null), "phonetic" => reader.ReadValue(options, null), "porter_stem" => reader.ReadValue(options, null), "predicate_token_filter" => reader.ReadValue(options, null), "remove_duplicates" => reader.ReadValue(options, null), "reverse" => reader.ReadValue(options, null), + "scandinavian_folding" => reader.ReadValue(options, null), + "scandinavian_normalization" => reader.ReadValue(options, null), + "serbian_normalization" => reader.ReadValue(options, null), "shingle" => reader.ReadValue(options, null), "snowball" => reader.ReadValue(options, null), + "sorani_normalization" => reader.ReadValue(options, null), "stemmer" => reader.ReadValue(options, null), "stemmer_override" => reader.ReadValue(options, null), "stop" => reader.ReadValue(options, null), @@ -100,15 +118,33 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { switch (value.Type) { + case "apostrophe": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilter)value, null); + break; + case "arabic_normalization": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilter)value, null); + break; case "asciifolding": writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.AsciiFoldingTokenFilter)value, null); break; + case "cjk_bigram": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilter)value, null); + break; + case "cjk_width": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilter)value, null); + break; + case "classic": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilter)value, null); + break; case "common_grams": writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.CommonGramsTokenFilter)value, null); break; case "condition": writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ConditionTokenFilter)value, null); break; + case "decimal_digit": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilter)value, null); + break; case "delimited_payload": writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadTokenFilter)value, null); break; @@ -124,6 +160,15 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien case "fingerprint": writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.FingerprintTokenFilter)value, null); break; + case "flatten_graph": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilter)value, null); + break; + case "german_normalization": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilter)value, null); + break; + case "hindi_normalization": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilter)value, null); + break; case "hunspell": writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.HunspellTokenFilter)value, null); break; @@ -142,6 +187,12 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien case "icu_transform": writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.IcuTransformTokenFilter)value, null); break; + case "indic_normalization": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilter)value, null); + break; + case "ja_stop": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilter)value, null); + break; case "keep": writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KeepWordsTokenFilter)value, null); break; @@ -151,6 +202,9 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien case "keyword_marker": writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KeywordMarkerTokenFilter)value, null); break; + case "keyword_repeat": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilter)value, null); + break; case "kstem": writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.KStemTokenFilter)value, null); break; @@ -172,6 +226,9 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien case "lowercase": writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilter)value, null); break; + case "min_hash": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilter)value, null); + break; case "multiplexer": writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.MultiplexerTokenFilter)value, null); break; @@ -187,6 +244,9 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien case "pattern_replace": writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PatternReplaceTokenFilter)value, null); break; + case "persian_normalization": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilter)value, null); + break; case "phonetic": writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.PhoneticTokenFilter)value, null); break; @@ -202,12 +262,24 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien case "reverse": writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ReverseTokenFilter)value, null); break; + case "scandinavian_folding": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilter)value, null); + break; + case "scandinavian_normalization": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilter)value, null); + break; + case "serbian_normalization": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilter)value, null); + break; case "shingle": writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.ShingleTokenFilter)value, null); break; case "snowball": writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SnowballTokenFilter)value, null); break; + case "sorani_normalization": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilter)value, null); + break; case "stemmer": writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Analysis.StemmerTokenFilter)value, null); break; @@ -255,6 +327,36 @@ public partial interface ITokenFilter public readonly partial struct TokenFilterFactory { + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter Apostrophe(Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilter value) + { + return value; + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter Apostrophe() + { + return Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilterDescriptor.Build(null); + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter Apostrophe(System.Action? action) + { + return Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilterDescriptor.Build(action); + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter ArabicNormalization(Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilter value) + { + return value; + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter ArabicNormalization() + { + return Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilterDescriptor.Build(null); + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter ArabicNormalization(System.Action? action) + { + return Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilterDescriptor.Build(action); + } + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter AsciiFolding(Elastic.Clients.Elasticsearch.Analysis.AsciiFoldingTokenFilter value) { return value; @@ -270,6 +372,51 @@ public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter AsciiFolding(System.A return Elastic.Clients.Elasticsearch.Analysis.AsciiFoldingTokenFilterDescriptor.Build(action); } + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter CjkBigram(Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilter value) + { + return value; + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter CjkBigram() + { + return Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilterDescriptor.Build(null); + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter CjkBigram(System.Action? action) + { + return Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilterDescriptor.Build(action); + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter CjkWidth(Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilter value) + { + return value; + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter CjkWidth() + { + return Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilterDescriptor.Build(null); + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter CjkWidth(System.Action? action) + { + return Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilterDescriptor.Build(action); + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter Classic(Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilter value) + { + return value; + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter Classic() + { + return Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilterDescriptor.Build(null); + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter Classic(System.Action? action) + { + return Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilterDescriptor.Build(action); + } + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter CommonGrams(Elastic.Clients.Elasticsearch.Analysis.CommonGramsTokenFilter value) { return value; @@ -295,6 +442,21 @@ public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter Condition(System.Acti return Elastic.Clients.Elasticsearch.Analysis.ConditionTokenFilterDescriptor.Build(action); } + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter DecimalDigit(Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilter value) + { + return value; + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter DecimalDigit() + { + return Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilterDescriptor.Build(null); + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter DecimalDigit(System.Action? action) + { + return Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilterDescriptor.Build(action); + } + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter DelimitedPayload(Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadTokenFilter value) { return value; @@ -370,6 +532,51 @@ public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter Fingerprint(System.Ac return Elastic.Clients.Elasticsearch.Analysis.FingerprintTokenFilterDescriptor.Build(action); } + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter FlattenGraph(Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilter value) + { + return value; + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter FlattenGraph() + { + return Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilterDescriptor.Build(null); + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter FlattenGraph(System.Action? action) + { + return Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilterDescriptor.Build(action); + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter GermanNormalization(Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilter value) + { + return value; + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter GermanNormalization() + { + return Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilterDescriptor.Build(null); + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter GermanNormalization(System.Action? action) + { + return Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilterDescriptor.Build(action); + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter HindiNormalization(Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilter value) + { + return value; + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter HindiNormalization() + { + return Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilterDescriptor.Build(null); + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter HindiNormalization(System.Action? action) + { + return Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilterDescriptor.Build(action); + } + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter Hunspell(Elastic.Clients.Elasticsearch.Analysis.HunspellTokenFilter value) { return value; @@ -385,12 +592,7 @@ public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter HyphenationDecompound return value; } - public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter HyphenationDecompounder() - { - return Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilterDescriptor.Build(null); - } - - public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter HyphenationDecompounder(System.Action? action) + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter HyphenationDecompounder(System.Action action) { return Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilterDescriptor.Build(action); } @@ -440,6 +642,36 @@ public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter IcuTransform(System.A return Elastic.Clients.Elasticsearch.Analysis.IcuTransformTokenFilterDescriptor.Build(action); } + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter IndicNormalization(Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilter value) + { + return value; + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter IndicNormalization() + { + return Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilterDescriptor.Build(null); + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter IndicNormalization(System.Action? action) + { + return Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilterDescriptor.Build(action); + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter JaStop(Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilter value) + { + return value; + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter JaStop() + { + return Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilterDescriptor.Build(null); + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter JaStop(System.Action? action) + { + return Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilterDescriptor.Build(action); + } + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter KeepWords(Elastic.Clients.Elasticsearch.Analysis.KeepWordsTokenFilter value) { return value; @@ -460,12 +692,7 @@ public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter KeepTypes(Elastic.Cli return value; } - public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter KeepTypes() - { - return Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilterDescriptor.Build(null); - } - - public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter KeepTypes(System.Action? action) + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter KeepTypes(System.Action action) { return Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilterDescriptor.Build(action); } @@ -485,6 +712,21 @@ public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter KeywordMarker(System. return Elastic.Clients.Elasticsearch.Analysis.KeywordMarkerTokenFilterDescriptor.Build(action); } + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter KeywordRepeat(Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilter value) + { + return value; + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter KeywordRepeat() + { + return Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilterDescriptor.Build(null); + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter KeywordRepeat(System.Action? action) + { + return Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilterDescriptor.Build(action); + } + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter KStem(Elastic.Clients.Elasticsearch.Analysis.KStemTokenFilter value) { return value; @@ -575,6 +817,21 @@ public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter Lowercase(System.Acti return Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterDescriptor.Build(action); } + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter MinHash(Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilter value) + { + return value; + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter MinHash() + { + return Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilterDescriptor.Build(null); + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter MinHash(System.Action? action) + { + return Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilterDescriptor.Build(action); + } + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter Multiplexer(Elastic.Clients.Elasticsearch.Analysis.MultiplexerTokenFilter value) { return value; @@ -635,6 +892,21 @@ public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter PatternReplace(System return Elastic.Clients.Elasticsearch.Analysis.PatternReplaceTokenFilterDescriptor.Build(action); } + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter PersianNormalization(Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilter value) + { + return value; + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter PersianNormalization() + { + return Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilterDescriptor.Build(null); + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter PersianNormalization(System.Action? action) + { + return Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilterDescriptor.Build(action); + } + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter Phonetic(Elastic.Clients.Elasticsearch.Analysis.PhoneticTokenFilter value) { return value; @@ -700,6 +972,51 @@ public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter Reverse(System.Action return Elastic.Clients.Elasticsearch.Analysis.ReverseTokenFilterDescriptor.Build(action); } + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter ScandinavianFolding(Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilter value) + { + return value; + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter ScandinavianFolding() + { + return Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilterDescriptor.Build(null); + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter ScandinavianFolding(System.Action? action) + { + return Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilterDescriptor.Build(action); + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter ScandinavianNormalization(Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilter value) + { + return value; + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter ScandinavianNormalization() + { + return Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilterDescriptor.Build(null); + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter ScandinavianNormalization(System.Action? action) + { + return Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilterDescriptor.Build(action); + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter SerbianNormalization(Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilter value) + { + return value; + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter SerbianNormalization() + { + return Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilterDescriptor.Build(null); + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter SerbianNormalization(System.Action? action) + { + return Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilterDescriptor.Build(action); + } + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter Shingle(Elastic.Clients.Elasticsearch.Analysis.ShingleTokenFilter value) { return value; @@ -730,6 +1047,21 @@ public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter Snowball(System.Actio return Elastic.Clients.Elasticsearch.Analysis.SnowballTokenFilterDescriptor.Build(action); } + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter SoraniNormalization(Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilter value) + { + return value; + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter SoraniNormalization() + { + return Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilterDescriptor.Build(null); + } + + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter SoraniNormalization(System.Action? action) + { + return Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilterDescriptor.Build(action); + } + public Elastic.Clients.Elasticsearch.Analysis.ITokenFilter Stemmer(Elastic.Clients.Elasticsearch.Analysis.StemmerTokenFilter value) { return value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenFilters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenFilters.g.cs index 42e17fafcb..3f92a997af 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenFilters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TokenFilters.g.cs @@ -73,6 +73,42 @@ public TokenFiltersDescriptor() { } + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor Apostrophe(string key, Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilter value) + { + _items.Add(key, value); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor Apostrophe(string key) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilterDescriptor.Build(null)); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor Apostrophe(string key, System.Action? action) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.ApostropheTokenFilterDescriptor.Build(action)); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor ArabicNormalization(string key, Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilter value) + { + _items.Add(key, value); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor ArabicNormalization(string key) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilterDescriptor.Build(null)); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor ArabicNormalization(string key, System.Action? action) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.ArabicNormalizationTokenFilterDescriptor.Build(action)); + return this; + } + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor AsciiFolding(string key, Elastic.Clients.Elasticsearch.Analysis.AsciiFoldingTokenFilter value) { _items.Add(key, value); @@ -91,6 +127,60 @@ public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor AsciiFoldin return this; } + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor CjkBigram(string key, Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilter value) + { + _items.Add(key, value); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor CjkBigram(string key) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilterDescriptor.Build(null)); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor CjkBigram(string key, System.Action? action) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.CjkBigramTokenFilterDescriptor.Build(action)); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor CjkWidth(string key, Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilter value) + { + _items.Add(key, value); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor CjkWidth(string key) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilterDescriptor.Build(null)); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor CjkWidth(string key, System.Action? action) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.CjkWidthTokenFilterDescriptor.Build(action)); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor Classic(string key, Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilter value) + { + _items.Add(key, value); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor Classic(string key) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilterDescriptor.Build(null)); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor Classic(string key, System.Action? action) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.ClassicTokenFilterDescriptor.Build(action)); + return this; + } + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor CommonGrams(string key, Elastic.Clients.Elasticsearch.Analysis.CommonGramsTokenFilter value) { _items.Add(key, value); @@ -121,6 +211,24 @@ public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor Condition(s return this; } + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor DecimalDigit(string key, Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilter value) + { + _items.Add(key, value); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor DecimalDigit(string key) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilterDescriptor.Build(null)); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor DecimalDigit(string key, System.Action? action) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.DecimalDigitTokenFilterDescriptor.Build(action)); + return this; + } + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor DelimitedPayload(string key, Elastic.Clients.Elasticsearch.Analysis.DelimitedPayloadTokenFilter value) { _items.Add(key, value); @@ -211,31 +319,79 @@ public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor Fingerprint return this; } - public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor Hunspell(string key, Elastic.Clients.Elasticsearch.Analysis.HunspellTokenFilter value) + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor FlattenGraph(string key, Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilter value) { _items.Add(key, value); return this; } - public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor Hunspell(string key, System.Action action) + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor FlattenGraph(string key) { - _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.HunspellTokenFilterDescriptor.Build(action)); + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilterDescriptor.Build(null)); return this; } - public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor HyphenationDecompounder(string key, Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilter value) + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor FlattenGraph(string key, System.Action? action) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.FlattenGraphTokenFilterDescriptor.Build(action)); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor GermanNormalization(string key, Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilter value) + { + _items.Add(key, value); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor GermanNormalization(string key) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilterDescriptor.Build(null)); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor GermanNormalization(string key, System.Action? action) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.GermanNormalizationTokenFilterDescriptor.Build(action)); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor HindiNormalization(string key, Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilter value) + { + _items.Add(key, value); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor HindiNormalization(string key) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilterDescriptor.Build(null)); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor HindiNormalization(string key, System.Action? action) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.HindiNormalizationTokenFilterDescriptor.Build(action)); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor Hunspell(string key, Elastic.Clients.Elasticsearch.Analysis.HunspellTokenFilter value) { _items.Add(key, value); return this; } - public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor HyphenationDecompounder(string key) + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor Hunspell(string key, System.Action action) { - _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilterDescriptor.Build(null)); + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.HunspellTokenFilterDescriptor.Build(action)); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor HyphenationDecompounder(string key, Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilter value) + { + _items.Add(key, value); return this; } - public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor HyphenationDecompounder(string key, System.Action? action) + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor HyphenationDecompounder(string key, System.Action action) { _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.HyphenationDecompounderTokenFilterDescriptor.Build(action)); return this; @@ -295,6 +451,42 @@ public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor IcuTransfor return this; } + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor IndicNormalization(string key, Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilter value) + { + _items.Add(key, value); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor IndicNormalization(string key) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilterDescriptor.Build(null)); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor IndicNormalization(string key, System.Action? action) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.IndicNormalizationTokenFilterDescriptor.Build(action)); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor JaStop(string key, Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilter value) + { + _items.Add(key, value); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor JaStop(string key) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilterDescriptor.Build(null)); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor JaStop(string key, System.Action? action) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.JaStopTokenFilterDescriptor.Build(action)); + return this; + } + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor KeepWords(string key, Elastic.Clients.Elasticsearch.Analysis.KeepWordsTokenFilter value) { _items.Add(key, value); @@ -319,13 +511,7 @@ public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor KeepTypes(s return this; } - public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor KeepTypes(string key) - { - _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilterDescriptor.Build(null)); - return this; - } - - public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor KeepTypes(string key, System.Action? action) + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor KeepTypes(string key, System.Action action) { _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.KeepTypesTokenFilterDescriptor.Build(action)); return this; @@ -349,6 +535,24 @@ public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor KeywordMark return this; } + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor KeywordRepeat(string key, Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilter value) + { + _items.Add(key, value); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor KeywordRepeat(string key) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilterDescriptor.Build(null)); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor KeywordRepeat(string key, System.Action? action) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.KeywordRepeatTokenFilterDescriptor.Build(action)); + return this; + } + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor KStem(string key, Elastic.Clients.Elasticsearch.Analysis.KStemTokenFilter value) { _items.Add(key, value); @@ -457,6 +661,24 @@ public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor Lowercase(s return this; } + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor MinHash(string key, Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilter value) + { + _items.Add(key, value); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor MinHash(string key) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilterDescriptor.Build(null)); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor MinHash(string key, System.Action? action) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.MinHashTokenFilterDescriptor.Build(action)); + return this; + } + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor Multiplexer(string key, Elastic.Clients.Elasticsearch.Analysis.MultiplexerTokenFilter value) { _items.Add(key, value); @@ -529,6 +751,24 @@ public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor PatternRepl return this; } + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor PersianNormalization(string key, Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilter value) + { + _items.Add(key, value); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor PersianNormalization(string key) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilterDescriptor.Build(null)); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor PersianNormalization(string key, System.Action? action) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.PersianNormalizationTokenFilterDescriptor.Build(action)); + return this; + } + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor Phonetic(string key, Elastic.Clients.Elasticsearch.Analysis.PhoneticTokenFilter value) { _items.Add(key, value); @@ -607,6 +847,60 @@ public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor Reverse(str return this; } + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor ScandinavianFolding(string key, Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilter value) + { + _items.Add(key, value); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor ScandinavianFolding(string key) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilterDescriptor.Build(null)); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor ScandinavianFolding(string key, System.Action? action) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.ScandinavianFoldingTokenFilterDescriptor.Build(action)); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor ScandinavianNormalization(string key, Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilter value) + { + _items.Add(key, value); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor ScandinavianNormalization(string key) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilterDescriptor.Build(null)); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor ScandinavianNormalization(string key, System.Action? action) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.ScandinavianNormalizationTokenFilterDescriptor.Build(action)); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor SerbianNormalization(string key, Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilter value) + { + _items.Add(key, value); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor SerbianNormalization(string key) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilterDescriptor.Build(null)); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor SerbianNormalization(string key, System.Action? action) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.SerbianNormalizationTokenFilterDescriptor.Build(action)); + return this; + } + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor Shingle(string key, Elastic.Clients.Elasticsearch.Analysis.ShingleTokenFilter value) { _items.Add(key, value); @@ -643,6 +937,24 @@ public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor Snowball(st return this; } + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor SoraniNormalization(string key, Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilter value) + { + _items.Add(key, value); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor SoraniNormalization(string key) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilterDescriptor.Build(null)); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor SoraniNormalization(string key, System.Action? action) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.SoraniNormalizationTokenFilterDescriptor.Build(action)); + return this; + } + public Elastic.Clients.Elasticsearch.Analysis.TokenFiltersDescriptor Stemmer(string key, Elastic.Clients.Elasticsearch.Analysis.StemmerTokenFilter value) { _items.Add(key, value); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TruncateTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TruncateTokenFilter.g.cs index 98c58010c7..d447d1a6fd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TruncateTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TruncateTokenFilter.g.cs @@ -98,6 +98,11 @@ internal TruncateTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonCon _ = sentinel; } + /// + /// + /// Character limit for each token. Tokens exceeding this limit are truncated. Defaults to 10. + /// + /// public int? Length { get; set; } public string Type => "truncate"; @@ -124,6 +129,11 @@ public TruncateTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.TruncateTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.TruncateTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.TruncateTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.TruncateTokenFilter(Elastic.Clients.Elasticsearch.Analysis.TruncateTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// Character limit for each token. Tokens exceeding this limit are truncated. Defaults to 10. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.TruncateTokenFilterDescriptor Length(int? value) { Instance.Length = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TurkishAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TurkishAnalyzer.g.cs index 65f1b5764e..684b6c077c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TurkishAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/TurkishAnalyzer.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.TurkishAnalyzer Read(ref { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propStemExclusion = default; - LocalJsonValue?> propStopwords = default; + LocalJsonValue>?> propStopwords = default; LocalJsonValue propStopwordsPath = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -43,7 +43,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.TurkishAnalyzer Read(ref continue; } - if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopwords.TryReadProperty(ref reader, options, PropStopwords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -81,7 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropStemExclusion, value.StemExclusion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); - writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopwords, value.Stopwords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropStopwordsPath, value.StopwordsPath, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); @@ -108,7 +108,7 @@ internal TurkishAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstru } public System.Collections.Generic.ICollection? StemExclusion { get; set; } - public System.Collections.Generic.ICollection? Stopwords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? Stopwords { get; set; } public string? StopwordsPath { get; set; } public string Type => "turkish"; @@ -145,18 +145,12 @@ public Elastic.Clients.Elasticsearch.Analysis.TurkishAnalyzerDescriptor StemExcl return this; } - public Elastic.Clients.Elasticsearch.Analysis.TurkishAnalyzerDescriptor Stopwords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Analysis.TurkishAnalyzerDescriptor Stopwords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.Stopwords = value; return this; } - public Elastic.Clients.Elasticsearch.Analysis.TurkishAnalyzerDescriptor Stopwords(params string[] values) - { - Instance.Stopwords = [.. values]; - return this; - } - public Elastic.Clients.Elasticsearch.Analysis.TurkishAnalyzerDescriptor StopwordsPath(string? value) { Instance.StopwordsPath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UniqueTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UniqueTokenFilter.g.cs index 15c8197fc0..9aef22b230 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UniqueTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/UniqueTokenFilter.g.cs @@ -98,6 +98,11 @@ internal UniqueTokenFilter(Elastic.Clients.Elasticsearch.Serialization.JsonConst _ = sentinel; } + /// + /// + /// If true, only remove duplicate tokens in the same position. Defaults to false. + /// + /// public bool? OnlyOnSamePosition { get; set; } public string Type => "unique"; @@ -124,6 +129,11 @@ public UniqueTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.UniqueTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.UniqueTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.UniqueTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.UniqueTokenFilter(Elastic.Clients.Elasticsearch.Analysis.UniqueTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// If true, only remove duplicate tokens in the same position. Defaults to false. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.UniqueTokenFilterDescriptor OnlyOnSamePosition(bool? value = true) { Instance.OnlyOnSamePosition = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterGraphTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterGraphTokenFilter.g.cs index abfd235385..542fdb6341 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterGraphTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterGraphTokenFilter.g.cs @@ -224,23 +224,112 @@ internal WordDelimiterGraphTokenFilter(Elastic.Clients.Elasticsearch.Serializati _ = sentinel; } + /// + /// + /// If true, the filter adjusts the offsets of split or catenated tokens to better reflect their actual position in the token stream. Defaults to true. + /// + /// public bool? AdjustOffsets { get; set; } + + /// + /// + /// If true, the filter produces catenated tokens for chains of alphanumeric characters separated by non-alphabetic delimiters. Defaults to false. + /// + /// public bool? CatenateAll { get; set; } + + /// + /// + /// If true, the filter produces catenated tokens for chains of numeric characters separated by non-alphabetic delimiters. Defaults to false. + /// + /// public bool? CatenateNumbers { get; set; } + + /// + /// + /// If true, the filter produces catenated tokens for chains of alphabetical characters separated by non-alphabetic delimiters. Defaults to false. + /// + /// public bool? CatenateWords { get; set; } + + /// + /// + /// If true, the filter includes tokens consisting of only numeric characters in the output. If false, the filter excludes these tokens from the output. Defaults to true. + /// + /// public bool? GenerateNumberParts { get; set; } + + /// + /// + /// If true, the filter includes tokens consisting of only alphabetical characters in the output. If false, the filter excludes these tokens from the output. Defaults to true. + /// + /// public bool? GenerateWordParts { get; set; } + + /// + /// + /// If true, the filter skips tokens with a keyword attribute of true. Defaults to false. + /// + /// public bool? IgnoreKeywords { get; set; } + + /// + /// + /// If true, the filter includes the original version of any split tokens in the output. This original version includes non-alphanumeric delimiters. Defaults to false. + /// + /// public bool? PreserveOriginal { get; set; } + + /// + /// + /// Array of tokens the filter won’t split. + /// + /// public System.Collections.Generic.ICollection? ProtectedWords { get; set; } + + /// + /// + /// Path to a file that contains a list of tokens the filter won’t split. + /// This path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each token in the file must be separated by a line break. + /// + /// public string? ProtectedWordsPath { get; set; } + + /// + /// + /// If true, the filter splits tokens at letter case transitions. For example: camelCase -> [ camel, Case ]. Defaults to true. + /// + /// public bool? SplitOnCaseChange { get; set; } + + /// + /// + /// If true, the filter splits tokens at letter-number transitions. For example: j2se -> [ j, 2, se ]. Defaults to true. + /// + /// public bool? SplitOnNumerics { get; set; } + + /// + /// + /// If true, the filter removes the English possessive ('s) from the end of each token. For example: O'Neil's -> [ O, Neil ]. Defaults to true. + /// + /// public bool? StemEnglishPossessive { get; set; } public string Type => "word_delimiter_graph"; + /// + /// + /// Array of custom type mappings for characters. This allows you to map non-alphanumeric characters as numeric or alphanumeric to avoid splitting on those characters. + /// + /// public System.Collections.Generic.ICollection? TypeTable { get; set; } + + /// + /// + /// Path to a file that contains custom type mappings for characters. This allows you to map non-alphanumeric characters as numeric or alphanumeric to avoid splitting on those characters. + /// + /// public string? TypeTablePath { get; set; } public string? Version { get; set; } } @@ -264,102 +353,188 @@ public WordDelimiterGraphTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilter(Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// If true, the filter adjusts the offsets of split or catenated tokens to better reflect their actual position in the token stream. Defaults to true. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilterDescriptor AdjustOffsets(bool? value = true) { Instance.AdjustOffsets = value; return this; } + /// + /// + /// If true, the filter produces catenated tokens for chains of alphanumeric characters separated by non-alphabetic delimiters. Defaults to false. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilterDescriptor CatenateAll(bool? value = true) { Instance.CatenateAll = value; return this; } + /// + /// + /// If true, the filter produces catenated tokens for chains of numeric characters separated by non-alphabetic delimiters. Defaults to false. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilterDescriptor CatenateNumbers(bool? value = true) { Instance.CatenateNumbers = value; return this; } + /// + /// + /// If true, the filter produces catenated tokens for chains of alphabetical characters separated by non-alphabetic delimiters. Defaults to false. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilterDescriptor CatenateWords(bool? value = true) { Instance.CatenateWords = value; return this; } + /// + /// + /// If true, the filter includes tokens consisting of only numeric characters in the output. If false, the filter excludes these tokens from the output. Defaults to true. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilterDescriptor GenerateNumberParts(bool? value = true) { Instance.GenerateNumberParts = value; return this; } + /// + /// + /// If true, the filter includes tokens consisting of only alphabetical characters in the output. If false, the filter excludes these tokens from the output. Defaults to true. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilterDescriptor GenerateWordParts(bool? value = true) { Instance.GenerateWordParts = value; return this; } + /// + /// + /// If true, the filter skips tokens with a keyword attribute of true. Defaults to false. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilterDescriptor IgnoreKeywords(bool? value = true) { Instance.IgnoreKeywords = value; return this; } + /// + /// + /// If true, the filter includes the original version of any split tokens in the output. This original version includes non-alphanumeric delimiters. Defaults to false. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilterDescriptor PreserveOriginal(bool? value = true) { Instance.PreserveOriginal = value; return this; } + /// + /// + /// Array of tokens the filter won’t split. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilterDescriptor ProtectedWords(System.Collections.Generic.ICollection? value) { Instance.ProtectedWords = value; return this; } + /// + /// + /// Array of tokens the filter won’t split. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilterDescriptor ProtectedWords(params string[] values) { Instance.ProtectedWords = [.. values]; return this; } + /// + /// + /// Path to a file that contains a list of tokens the filter won’t split. + /// This path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each token in the file must be separated by a line break. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilterDescriptor ProtectedWordsPath(string? value) { Instance.ProtectedWordsPath = value; return this; } + /// + /// + /// If true, the filter splits tokens at letter case transitions. For example: camelCase -> [ camel, Case ]. Defaults to true. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilterDescriptor SplitOnCaseChange(bool? value = true) { Instance.SplitOnCaseChange = value; return this; } + /// + /// + /// If true, the filter splits tokens at letter-number transitions. For example: j2se -> [ j, 2, se ]. Defaults to true. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilterDescriptor SplitOnNumerics(bool? value = true) { Instance.SplitOnNumerics = value; return this; } + /// + /// + /// If true, the filter removes the English possessive ('s) from the end of each token. For example: O'Neil's -> [ O, Neil ]. Defaults to true. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilterDescriptor StemEnglishPossessive(bool? value = true) { Instance.StemEnglishPossessive = value; return this; } + /// + /// + /// Array of custom type mappings for characters. This allows you to map non-alphanumeric characters as numeric or alphanumeric to avoid splitting on those characters. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilterDescriptor TypeTable(System.Collections.Generic.ICollection? value) { Instance.TypeTable = value; return this; } + /// + /// + /// Array of custom type mappings for characters. This allows you to map non-alphanumeric characters as numeric or alphanumeric to avoid splitting on those characters. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilterDescriptor TypeTable(params string[] values) { Instance.TypeTable = [.. values]; return this; } + /// + /// + /// Path to a file that contains custom type mappings for characters. This allows you to map non-alphanumeric characters as numeric or alphanumeric to avoid splitting on those characters. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterGraphTokenFilterDescriptor TypeTablePath(string? value) { Instance.TypeTablePath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterTokenFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterTokenFilter.g.cs index 4ac8626cf6..0cad9dcd3f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterTokenFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/WordDelimiterTokenFilter.g.cs @@ -206,21 +206,98 @@ internal WordDelimiterTokenFilter(Elastic.Clients.Elasticsearch.Serialization.Js _ = sentinel; } + /// + /// + /// If true, the filter produces catenated tokens for chains of alphanumeric characters separated by non-alphabetic delimiters. Defaults to false. + /// + /// public bool? CatenateAll { get; set; } + + /// + /// + /// If true, the filter produces catenated tokens for chains of numeric characters separated by non-alphabetic delimiters. Defaults to false. + /// + /// public bool? CatenateNumbers { get; set; } + + /// + /// + /// If true, the filter produces catenated tokens for chains of alphabetical characters separated by non-alphabetic delimiters. Defaults to false. + /// + /// public bool? CatenateWords { get; set; } + + /// + /// + /// If true, the filter includes tokens consisting of only numeric characters in the output. If false, the filter excludes these tokens from the output. Defaults to true. + /// + /// public bool? GenerateNumberParts { get; set; } + + /// + /// + /// If true, the filter includes tokens consisting of only alphabetical characters in the output. If false, the filter excludes these tokens from the output. Defaults to true. + /// + /// public bool? GenerateWordParts { get; set; } + + /// + /// + /// If true, the filter includes the original version of any split tokens in the output. This original version includes non-alphanumeric delimiters. Defaults to false. + /// + /// public bool? PreserveOriginal { get; set; } + + /// + /// + /// Array of tokens the filter won’t split. + /// + /// public System.Collections.Generic.ICollection? ProtectedWords { get; set; } + + /// + /// + /// Path to a file that contains a list of tokens the filter won’t split. + /// This path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each token in the file must be separated by a line break. + /// + /// public string? ProtectedWordsPath { get; set; } + + /// + /// + /// If true, the filter splits tokens at letter case transitions. For example: camelCase -> [ camel, Case ]. Defaults to true. + /// + /// public bool? SplitOnCaseChange { get; set; } + + /// + /// + /// If true, the filter splits tokens at letter-number transitions. For example: j2se -> [ j, 2, se ]. Defaults to true. + /// + /// public bool? SplitOnNumerics { get; set; } + + /// + /// + /// If true, the filter removes the English possessive ('s) from the end of each token. For example: O'Neil's -> [ O, Neil ]. Defaults to true. + /// + /// public bool? StemEnglishPossessive { get; set; } public string Type => "word_delimiter"; + /// + /// + /// Array of custom type mappings for characters. This allows you to map non-alphanumeric characters as numeric or alphanumeric to avoid splitting on those characters. + /// + /// public System.Collections.Generic.ICollection? TypeTable { get; set; } + + /// + /// + /// Path to a file that contains custom type mappings for characters. This allows you to map non-alphanumeric characters as numeric or alphanumeric to avoid splitting on those characters. + /// + /// public string? TypeTablePath { get; set; } public string? Version { get; set; } } @@ -244,90 +321,166 @@ public WordDelimiterTokenFilterDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilterDescriptor(Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilter instance) => new Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilterDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilter(Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilterDescriptor descriptor) => descriptor.Instance; + /// + /// + /// If true, the filter produces catenated tokens for chains of alphanumeric characters separated by non-alphabetic delimiters. Defaults to false. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilterDescriptor CatenateAll(bool? value = true) { Instance.CatenateAll = value; return this; } + /// + /// + /// If true, the filter produces catenated tokens for chains of numeric characters separated by non-alphabetic delimiters. Defaults to false. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilterDescriptor CatenateNumbers(bool? value = true) { Instance.CatenateNumbers = value; return this; } + /// + /// + /// If true, the filter produces catenated tokens for chains of alphabetical characters separated by non-alphabetic delimiters. Defaults to false. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilterDescriptor CatenateWords(bool? value = true) { Instance.CatenateWords = value; return this; } + /// + /// + /// If true, the filter includes tokens consisting of only numeric characters in the output. If false, the filter excludes these tokens from the output. Defaults to true. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilterDescriptor GenerateNumberParts(bool? value = true) { Instance.GenerateNumberParts = value; return this; } + /// + /// + /// If true, the filter includes tokens consisting of only alphabetical characters in the output. If false, the filter excludes these tokens from the output. Defaults to true. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilterDescriptor GenerateWordParts(bool? value = true) { Instance.GenerateWordParts = value; return this; } + /// + /// + /// If true, the filter includes the original version of any split tokens in the output. This original version includes non-alphanumeric delimiters. Defaults to false. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilterDescriptor PreserveOriginal(bool? value = true) { Instance.PreserveOriginal = value; return this; } + /// + /// + /// Array of tokens the filter won’t split. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilterDescriptor ProtectedWords(System.Collections.Generic.ICollection? value) { Instance.ProtectedWords = value; return this; } + /// + /// + /// Array of tokens the filter won’t split. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilterDescriptor ProtectedWords(params string[] values) { Instance.ProtectedWords = [.. values]; return this; } + /// + /// + /// Path to a file that contains a list of tokens the filter won’t split. + /// This path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each token in the file must be separated by a line break. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilterDescriptor ProtectedWordsPath(string? value) { Instance.ProtectedWordsPath = value; return this; } + /// + /// + /// If true, the filter splits tokens at letter case transitions. For example: camelCase -> [ camel, Case ]. Defaults to true. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilterDescriptor SplitOnCaseChange(bool? value = true) { Instance.SplitOnCaseChange = value; return this; } + /// + /// + /// If true, the filter splits tokens at letter-number transitions. For example: j2se -> [ j, 2, se ]. Defaults to true. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilterDescriptor SplitOnNumerics(bool? value = true) { Instance.SplitOnNumerics = value; return this; } + /// + /// + /// If true, the filter removes the English possessive ('s) from the end of each token. For example: O'Neil's -> [ O, Neil ]. Defaults to true. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilterDescriptor StemEnglishPossessive(bool? value = true) { Instance.StemEnglishPossessive = value; return this; } + /// + /// + /// Array of custom type mappings for characters. This allows you to map non-alphanumeric characters as numeric or alphanumeric to avoid splitting on those characters. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilterDescriptor TypeTable(System.Collections.Generic.ICollection? value) { Instance.TypeTable = value; return this; } + /// + /// + /// Array of custom type mappings for characters. This allows you to map non-alphanumeric characters as numeric or alphanumeric to avoid splitting on those characters. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilterDescriptor TypeTable(params string[] values) { Instance.TypeTable = [.. values]; return this; } + /// + /// + /// Path to a file that contains custom type mappings for characters. This allows you to map non-alphanumeric characters as numeric or alphanumeric to avoid splitting on those characters. + /// + /// public Elastic.Clients.Elasticsearch.Analysis.WordDelimiterTokenFilterDescriptor TypeTablePath(string? value) { Instance.TypeTablePath = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSStats.g.cs new file mode 100644 index 0000000000..c7cf186b2c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSStats.g.cs @@ -0,0 +1,134 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster; + +internal sealed partial class CCSStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClusters = System.Text.Json.JsonEncodedText.Encode("clusters"); + private static readonly System.Text.Json.JsonEncodedText PropEsql = System.Text.Json.JsonEncodedText.Encode("_esql"); + private static readonly System.Text.Json.JsonEncodedText PropSearch = System.Text.Json.JsonEncodedText.Encode("_search"); + + public override Elastic.Clients.Elasticsearch.Cluster.CCSStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propClusters = default; + LocalJsonValue propEsql = default; + LocalJsonValue propSearch = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClusters.TryReadProperty(ref reader, options, PropClusters, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propEsql.TryReadProperty(ref reader, options, PropEsql, null)) + { + continue; + } + + if (propSearch.TryReadProperty(ref reader, options, PropSearch, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.CCSStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Clusters = propClusters.Value, + Esql = propEsql.Value, + Search = propSearch.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.CCSStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClusters, value.Clusters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropEsql, value.Esql, null, null); + writer.WriteProperty(options, PropSearch, value.Search, null, null); + writer.WriteEndObject(); + } +} + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.CCSStatsConverter))] +public sealed partial class CCSStats +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CCSStats(Elastic.Clients.Elasticsearch.Cluster.CCSUsageStats search) + { + Search = search; + } +#if NET7_0_OR_GREATER + public CCSStats() + { + } +#endif +#if !NET7_0_OR_GREATER + [System.Obsolete("The type contains required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] + public CCSStats() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal CCSStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// Contains remote cluster settings and metrics collected from them. + /// The keys are cluster names, and the values are per-cluster data. + /// Only present if include_remotes option is set to true. + /// + /// + public System.Collections.Generic.IReadOnlyDictionary? Clusters { get; set; } + + /// + /// + /// Information about ES|QL cross-cluster query usage. + /// + /// + public Elastic.Clients.Elasticsearch.Cluster.CCSUsageStats? Esql { get; set; } + + /// + /// + /// Information about cross-cluster search usage. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + Elastic.Clients.Elasticsearch.Cluster.CCSUsageStats Search { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageClusterStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageClusterStats.g.cs new file mode 100644 index 0000000000..8465c8bd20 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageClusterStats.g.cs @@ -0,0 +1,142 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster; + +internal sealed partial class CCSUsageClusterStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSkipped = System.Text.Json.JsonEncodedText.Encode("skipped"); + private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Cluster.CCSUsageClusterStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propSkipped = default; + LocalJsonValue propTook = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSkipped.TryReadProperty(ref reader, options, PropSkipped, null)) + { + continue; + } + + if (propTook.TryReadProperty(ref reader, options, PropTook, null)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.CCSUsageClusterStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Skipped = propSkipped.Value, + Took = propTook.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.CCSUsageClusterStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSkipped, value.Skipped, null, null); + writer.WriteProperty(options, PropTook, value.Took, null, null); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.CCSUsageClusterStatsConverter))] +public sealed partial class CCSUsageClusterStats +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CCSUsageClusterStats(int skipped, Elastic.Clients.Elasticsearch.Cluster.CCSUsageTimeValue took, int total) + { + Skipped = skipped; + Took = took; + Total = total; + } +#if NET7_0_OR_GREATER + public CCSUsageClusterStats() + { + } +#endif +#if !NET7_0_OR_GREATER + [System.Obsolete("The type contains required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] + public CCSUsageClusterStats() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal CCSUsageClusterStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// The total number of cross-cluster search requests for which this cluster was skipped. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + int Skipped { get; set; } + + /// + /// + /// Statistics about the time taken to execute requests against this cluster. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + Elastic.Clients.Elasticsearch.Cluster.CCSUsageTimeValue Took { get; set; } + + /// + /// + /// The total number of successful (not skipped) cross-cluster search requests that were executed against this cluster. This may include requests where partial results were returned, but not requests in which the cluster has been skipped entirely. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + int Total { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageStats.g.cs new file mode 100644 index 0000000000..e16cc91c4d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageStats.g.cs @@ -0,0 +1,321 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster; + +internal sealed partial class CCSUsageStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClients = System.Text.Json.JsonEncodedText.Encode("clients"); + private static readonly System.Text.Json.JsonEncodedText PropClusters = System.Text.Json.JsonEncodedText.Encode("clusters"); + private static readonly System.Text.Json.JsonEncodedText PropFailureReasons = System.Text.Json.JsonEncodedText.Encode("failure_reasons"); + private static readonly System.Text.Json.JsonEncodedText PropFeatures = System.Text.Json.JsonEncodedText.Encode("features"); + private static readonly System.Text.Json.JsonEncodedText PropRemotesPerSearchAvg = System.Text.Json.JsonEncodedText.Encode("remotes_per_search_avg"); + private static readonly System.Text.Json.JsonEncodedText PropRemotesPerSearchMax = System.Text.Json.JsonEncodedText.Encode("remotes_per_search_max"); + private static readonly System.Text.Json.JsonEncodedText PropSkipped = System.Text.Json.JsonEncodedText.Encode("skipped"); + private static readonly System.Text.Json.JsonEncodedText PropSuccess = System.Text.Json.JsonEncodedText.Encode("success"); + private static readonly System.Text.Json.JsonEncodedText PropTook = System.Text.Json.JsonEncodedText.Encode("took"); + private static readonly System.Text.Json.JsonEncodedText PropTookMrtFalse = System.Text.Json.JsonEncodedText.Encode("took_mrt_false"); + private static readonly System.Text.Json.JsonEncodedText PropTookMrtTrue = System.Text.Json.JsonEncodedText.Encode("took_mrt_true"); + private static readonly System.Text.Json.JsonEncodedText PropTotal = System.Text.Json.JsonEncodedText.Encode("total"); + + public override Elastic.Clients.Elasticsearch.Cluster.CCSUsageStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propClients = default; + LocalJsonValue> propClusters = default; + LocalJsonValue> propFailureReasons = default; + LocalJsonValue> propFeatures = default; + LocalJsonValue propRemotesPerSearchAvg = default; + LocalJsonValue propRemotesPerSearchMax = default; + LocalJsonValue propSkipped = default; + LocalJsonValue propSuccess = default; + LocalJsonValue propTook = default; + LocalJsonValue propTookMrtFalse = default; + LocalJsonValue propTookMrtTrue = default; + LocalJsonValue propTotal = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClients.TryReadProperty(ref reader, options, PropClients, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propClusters.TryReadProperty(ref reader, options, PropClusters, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propFailureReasons.TryReadProperty(ref reader, options, PropFailureReasons, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propFeatures.TryReadProperty(ref reader, options, PropFeatures, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) + { + continue; + } + + if (propRemotesPerSearchAvg.TryReadProperty(ref reader, options, PropRemotesPerSearchAvg, null)) + { + continue; + } + + if (propRemotesPerSearchMax.TryReadProperty(ref reader, options, PropRemotesPerSearchMax, null)) + { + continue; + } + + if (propSkipped.TryReadProperty(ref reader, options, PropSkipped, null)) + { + continue; + } + + if (propSuccess.TryReadProperty(ref reader, options, PropSuccess, null)) + { + continue; + } + + if (propTook.TryReadProperty(ref reader, options, PropTook, null)) + { + continue; + } + + if (propTookMrtFalse.TryReadProperty(ref reader, options, PropTookMrtFalse, null)) + { + continue; + } + + if (propTookMrtTrue.TryReadProperty(ref reader, options, PropTookMrtTrue, null)) + { + continue; + } + + if (propTotal.TryReadProperty(ref reader, options, PropTotal, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.CCSUsageStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Clients = propClients.Value, + Clusters = propClusters.Value, + FailureReasons = propFailureReasons.Value, + Features = propFeatures.Value, + RemotesPerSearchAvg = propRemotesPerSearchAvg.Value, + RemotesPerSearchMax = propRemotesPerSearchMax.Value, + Skipped = propSkipped.Value, + Success = propSuccess.Value, + Took = propTook.Value, + TookMrtFalse = propTookMrtFalse.Value, + TookMrtTrue = propTookMrtTrue.Value, + Total = propTotal.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.CCSUsageStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClients, value.Clients, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropClusters, value.Clusters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropFailureReasons, value.FailureReasons, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropFeatures, value.Features, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropRemotesPerSearchAvg, value.RemotesPerSearchAvg, null, null); + writer.WriteProperty(options, PropRemotesPerSearchMax, value.RemotesPerSearchMax, null, null); + writer.WriteProperty(options, PropSkipped, value.Skipped, null, null); + writer.WriteProperty(options, PropSuccess, value.Success, null, null); + writer.WriteProperty(options, PropTook, value.Took, null, null); + writer.WriteProperty(options, PropTookMrtFalse, value.TookMrtFalse, null, null); + writer.WriteProperty(options, PropTookMrtTrue, value.TookMrtTrue, null, null); + writer.WriteProperty(options, PropTotal, value.Total, null, null); + writer.WriteEndObject(); + } +} + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.CCSUsageStatsConverter))] +public sealed partial class CCSUsageStats +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CCSUsageStats(System.Collections.Generic.IReadOnlyDictionary clients, System.Collections.Generic.IReadOnlyDictionary clusters, System.Collections.Generic.IReadOnlyDictionary failureReasons, System.Collections.Generic.IReadOnlyDictionary features, double remotesPerSearchAvg, int remotesPerSearchMax, int skipped, int success, Elastic.Clients.Elasticsearch.Cluster.CCSUsageTimeValue took, int total) + { + Clients = clients; + Clusters = clusters; + FailureReasons = failureReasons; + Features = features; + RemotesPerSearchAvg = remotesPerSearchAvg; + RemotesPerSearchMax = remotesPerSearchMax; + Skipped = skipped; + Success = success; + Took = took; + Total = total; + } +#if NET7_0_OR_GREATER + public CCSUsageStats() + { + } +#endif +#if !NET7_0_OR_GREATER + [System.Obsolete("The type contains required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] + public CCSUsageStats() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal CCSUsageStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// Statistics about the clients that executed cross-cluster search requests. The keys are the names of the clients, and the values are the number of requests that were executed by that client. Only known clients (such as kibana or elasticsearch) are counted. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + System.Collections.Generic.IReadOnlyDictionary Clients { get; set; } + + /// + /// + /// Statistics about the clusters that were queried in cross-cluster search requests. The keys are cluster names, and the values are per-cluster telemetry data. This also includes the local cluster itself, which uses the name (local). + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + System.Collections.Generic.IReadOnlyDictionary Clusters { get; set; } + + /// + /// + /// Statistics about the reasons for cross-cluster search request failures. The keys are the failure reason names and the values are the number of requests that failed for that reason. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + System.Collections.Generic.IReadOnlyDictionary FailureReasons { get; set; } + + /// + /// + /// The keys are the names of the search feature, and the values are the number of requests that used that feature. Single request can use more than one feature (e.g. both async and wildcard). + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + System.Collections.Generic.IReadOnlyDictionary Features { get; set; } + + /// + /// + /// The average number of remote clusters that were queried in a single cross-cluster search request. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + double RemotesPerSearchAvg { get; set; } + + /// + /// + /// The maximum number of remote clusters that were queried in a single cross-cluster search request. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + int RemotesPerSearchMax { get; set; } + + /// + /// + /// The total number of cross-cluster search requests (successful or failed) that had at least one remote cluster skipped. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + int Skipped { get; set; } + + /// + /// + /// The total number of cross-cluster search requests that have been successfully executed by the cluster. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + int Success { get; set; } + + /// + /// + /// Statistics about the time taken to execute cross-cluster search requests. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + Elastic.Clients.Elasticsearch.Cluster.CCSUsageTimeValue Took { get; set; } + + /// + /// + /// Statistics about the time taken to execute cross-cluster search requests for which the ccs_minimize_roundtrips setting was set to false. + /// + /// + public Elastic.Clients.Elasticsearch.Cluster.CCSUsageTimeValue? TookMrtFalse { get; set; } + + /// + /// + /// Statistics about the time taken to execute cross-cluster search requests for which the ccs_minimize_roundtrips setting was set to true. + /// + /// + public Elastic.Clients.Elasticsearch.Cluster.CCSUsageTimeValue? TookMrtTrue { get; set; } + + /// + /// + /// The total number of cross-cluster search requests that have been executed by the cluster. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + int Total { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageTimeValue.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageTimeValue.g.cs new file mode 100644 index 0000000000..396735b2cd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/CCSUsageTimeValue.g.cs @@ -0,0 +1,142 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster; + +internal sealed partial class CCSUsageTimeValueConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAvg = System.Text.Json.JsonEncodedText.Encode("avg"); + private static readonly System.Text.Json.JsonEncodedText PropMax = System.Text.Json.JsonEncodedText.Encode("max"); + private static readonly System.Text.Json.JsonEncodedText PropP90 = System.Text.Json.JsonEncodedText.Encode("p90"); + + public override Elastic.Clients.Elasticsearch.Cluster.CCSUsageTimeValue Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAvg = default; + LocalJsonValue propMax = default; + LocalJsonValue propP90 = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAvg.TryReadProperty(ref reader, options, PropAvg, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propMax.TryReadProperty(ref reader, options, PropMax, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propP90.TryReadProperty(ref reader, options, PropP90, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.CCSUsageTimeValue(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Avg = propAvg.Value, + Max = propMax.Value, + P90 = propP90.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.CCSUsageTimeValue value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAvg, value.Avg, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropMax, value.Max, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropP90, value.P90, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.CCSUsageTimeValueConverter))] +public sealed partial class CCSUsageTimeValue +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CCSUsageTimeValue(System.TimeSpan avg, System.TimeSpan max, System.TimeSpan p90) + { + Avg = avg; + Max = max; + P90 = p90; + } +#if NET7_0_OR_GREATER + public CCSUsageTimeValue() + { + } +#endif +#if !NET7_0_OR_GREATER + [System.Obsolete("The type contains required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] + public CCSUsageTimeValue() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal CCSUsageTimeValue(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// The average time taken to execute a request, in milliseconds. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + System.TimeSpan Avg { get; set; } + + /// + /// + /// The maximum time taken to execute a request, in milliseconds. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + System.TimeSpan Max { get; set; } + + /// + /// + /// The 90th percentile of the time taken to execute requests, in milliseconds. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + System.TimeSpan P90 { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RemoteClusterInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RemoteClusterInfo.g.cs new file mode 100644 index 0000000000..77265b62d2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/RemoteClusterInfo.g.cs @@ -0,0 +1,379 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster; + +internal sealed partial class RemoteClusterInfoConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropClusterUuid = System.Text.Json.JsonEncodedText.Encode("cluster_uuid"); + private static readonly System.Text.Json.JsonEncodedText PropIndicesCount = System.Text.Json.JsonEncodedText.Encode("indices_count"); + private static readonly System.Text.Json.JsonEncodedText PropIndicesTotalSize = System.Text.Json.JsonEncodedText.Encode("indices_total_size"); + private static readonly System.Text.Json.JsonEncodedText PropIndicesTotalSizeInBytes = System.Text.Json.JsonEncodedText.Encode("indices_total_size_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropMaxHeap = System.Text.Json.JsonEncodedText.Encode("max_heap"); + private static readonly System.Text.Json.JsonEncodedText PropMaxHeapInBytes = System.Text.Json.JsonEncodedText.Encode("max_heap_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropMemTotal = System.Text.Json.JsonEncodedText.Encode("mem_total"); + private static readonly System.Text.Json.JsonEncodedText PropMemTotalInBytes = System.Text.Json.JsonEncodedText.Encode("mem_total_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropMode = System.Text.Json.JsonEncodedText.Encode("mode"); + private static readonly System.Text.Json.JsonEncodedText PropNodesCount = System.Text.Json.JsonEncodedText.Encode("nodes_count"); + private static readonly System.Text.Json.JsonEncodedText PropShardsCount = System.Text.Json.JsonEncodedText.Encode("shards_count"); + private static readonly System.Text.Json.JsonEncodedText PropSkipUnavailable = System.Text.Json.JsonEncodedText.Encode("skip_unavailable"); + private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); + private static readonly System.Text.Json.JsonEncodedText PropTransportCompress = System.Text.Json.JsonEncodedText.Encode("transport_compress"); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"); + + public override Elastic.Clients.Elasticsearch.Cluster.RemoteClusterInfo Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propClusterUuid = default; + LocalJsonValue propIndicesCount = default; + LocalJsonValue propIndicesTotalSize = default; + LocalJsonValue propIndicesTotalSizeInBytes = default; + LocalJsonValue propMaxHeap = default; + LocalJsonValue propMaxHeapInBytes = default; + LocalJsonValue propMemTotal = default; + LocalJsonValue propMemTotalInBytes = default; + LocalJsonValue propMode = default; + LocalJsonValue propNodesCount = default; + LocalJsonValue propShardsCount = default; + LocalJsonValue propSkipUnavailable = default; + LocalJsonValue propStatus = default; + LocalJsonValue propTransportCompress = default; + LocalJsonValue> propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propClusterUuid.TryReadProperty(ref reader, options, PropClusterUuid, null)) + { + continue; + } + + if (propIndicesCount.TryReadProperty(ref reader, options, PropIndicesCount, null)) + { + continue; + } + + if (propIndicesTotalSize.TryReadProperty(ref reader, options, PropIndicesTotalSize, null)) + { + continue; + } + + if (propIndicesTotalSizeInBytes.TryReadProperty(ref reader, options, PropIndicesTotalSizeInBytes, null)) + { + continue; + } + + if (propMaxHeap.TryReadProperty(ref reader, options, PropMaxHeap, null)) + { + continue; + } + + if (propMaxHeapInBytes.TryReadProperty(ref reader, options, PropMaxHeapInBytes, null)) + { + continue; + } + + if (propMemTotal.TryReadProperty(ref reader, options, PropMemTotal, null)) + { + continue; + } + + if (propMemTotalInBytes.TryReadProperty(ref reader, options, PropMemTotalInBytes, null)) + { + continue; + } + + if (propMode.TryReadProperty(ref reader, options, PropMode, null)) + { + continue; + } + + if (propNodesCount.TryReadProperty(ref reader, options, PropNodesCount, null)) + { + continue; + } + + if (propShardsCount.TryReadProperty(ref reader, options, PropShardsCount, null)) + { + continue; + } + + if (propSkipUnavailable.TryReadProperty(ref reader, options, PropSkipUnavailable, null)) + { + continue; + } + + if (propStatus.TryReadProperty(ref reader, options, PropStatus, null)) + { + continue; + } + + if (propTransportCompress.TryReadProperty(ref reader, options, PropTransportCompress, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.Skip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.RemoteClusterInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ClusterUuid = propClusterUuid.Value, + IndicesCount = propIndicesCount.Value, + IndicesTotalSize = propIndicesTotalSize.Value, + IndicesTotalSizeInBytes = propIndicesTotalSizeInBytes.Value, + MaxHeap = propMaxHeap.Value, + MaxHeapInBytes = propMaxHeapInBytes.Value, + MemTotal = propMemTotal.Value, + MemTotalInBytes = propMemTotalInBytes.Value, + Mode = propMode.Value, + NodesCount = propNodesCount.Value, + ShardsCount = propShardsCount.Value, + SkipUnavailable = propSkipUnavailable.Value, + Status = propStatus.Value, + TransportCompress = propTransportCompress.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.RemoteClusterInfo value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropClusterUuid, value.ClusterUuid, null, null); + writer.WriteProperty(options, PropIndicesCount, value.IndicesCount, null, null); + writer.WriteProperty(options, PropIndicesTotalSize, value.IndicesTotalSize, null, null); + writer.WriteProperty(options, PropIndicesTotalSizeInBytes, value.IndicesTotalSizeInBytes, null, null); + writer.WriteProperty(options, PropMaxHeap, value.MaxHeap, null, null); + writer.WriteProperty(options, PropMaxHeapInBytes, value.MaxHeapInBytes, null, null); + writer.WriteProperty(options, PropMemTotal, value.MemTotal, null, null); + writer.WriteProperty(options, PropMemTotalInBytes, value.MemTotalInBytes, null, null); + writer.WriteProperty(options, PropMode, value.Mode, null, null); + writer.WriteProperty(options, PropNodesCount, value.NodesCount, null, null); + writer.WriteProperty(options, PropShardsCount, value.ShardsCount, null, null); + writer.WriteProperty(options, PropSkipUnavailable, value.SkipUnavailable, null, null); + writer.WriteProperty(options, PropStatus, value.Status, null, null); + writer.WriteProperty(options, PropTransportCompress, value.TransportCompress, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.RemoteClusterInfoConverter))] +public sealed partial class RemoteClusterInfo +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public RemoteClusterInfo(string clusterUuid, int indicesCount, long indicesTotalSizeInBytes, long maxHeapInBytes, long memTotalInBytes, string mode, int nodesCount, int shardsCount, bool skipUnavailable, Elastic.Clients.Elasticsearch.HealthStatus status, string transportCompress, System.Collections.Generic.IReadOnlyCollection version) + { + ClusterUuid = clusterUuid; + IndicesCount = indicesCount; + IndicesTotalSizeInBytes = indicesTotalSizeInBytes; + MaxHeapInBytes = maxHeapInBytes; + MemTotalInBytes = memTotalInBytes; + Mode = mode; + NodesCount = nodesCount; + ShardsCount = shardsCount; + SkipUnavailable = skipUnavailable; + Status = status; + TransportCompress = transportCompress; + Version = version; + } +#if NET7_0_OR_GREATER + public RemoteClusterInfo() + { + } +#endif +#if !NET7_0_OR_GREATER + [System.Obsolete("The type contains required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] + public RemoteClusterInfo() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal RemoteClusterInfo(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// The UUID of the remote cluster. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + string ClusterUuid { get; set; } + + /// + /// + /// The total number of indices in the remote cluster. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + int IndicesCount { get; set; } + + /// + /// + /// Total data set size of all shards assigned to selected nodes, as a human-readable string. + /// + /// + public string? IndicesTotalSize { get; set; } + + /// + /// + /// Total data set size, in bytes, of all shards assigned to selected nodes. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + long IndicesTotalSizeInBytes { get; set; } + + /// + /// + /// Maximum amount of memory available for use by the heap across the nodes of the remote cluster, as a human-readable string. + /// + /// + public string? MaxHeap { get; set; } + + /// + /// + /// Maximum amount of memory, in bytes, available for use by the heap across the nodes of the remote cluster. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + long MaxHeapInBytes { get; set; } + + /// + /// + /// Total amount of physical memory across the nodes of the remote cluster, as a human-readable string. + /// + /// + public string? MemTotal { get; set; } + + /// + /// + /// Total amount, in bytes, of physical memory across the nodes of the remote cluster. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + long MemTotalInBytes { get; set; } + + /// + /// + /// The connection mode used to communicate with the remote cluster. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + string Mode { get; set; } + + /// + /// + /// The total count of nodes in the remote cluster. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + int NodesCount { get; set; } + + /// + /// + /// The total number of shards in the remote cluster. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + int ShardsCount { get; set; } + + /// + /// + /// The skip_unavailable setting used for this remote cluster. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + bool SkipUnavailable { get; set; } + + /// + /// + /// Health status of the cluster, based on the state of its primary and replica shards. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + Elastic.Clients.Elasticsearch.HealthStatus Status { get; set; } + + /// + /// + /// Transport compression setting used for this remote cluster. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + string TransportCompress { get; set; } + + /// + /// + /// The list of Elasticsearch versions used by the nodes on the remote cluster. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + System.Collections.Generic.IReadOnlyCollection Version { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Analysis.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Analysis.g.cs index 287abe32b8..17cdca04f5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Analysis.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Analysis.g.cs @@ -478,33 +478,114 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, } } +internal sealed partial class LowercaseTokenFilterLanguagesConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberGreek = System.Text.Json.JsonEncodedText.Encode("greek"); + private static readonly System.Text.Json.JsonEncodedText MemberIrish = System.Text.Json.JsonEncodedText.Encode("irish"); + private static readonly System.Text.Json.JsonEncodedText MemberTurkish = System.Text.Json.JsonEncodedText.Encode("turkish"); + + public override Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberGreek)) + { + return Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages.Greek; + } + + if (reader.ValueTextEquals(MemberIrish)) + { + return Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages.Irish; + } + + if (reader.ValueTextEquals(MemberTurkish)) + { + return Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages.Turkish; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberGreek.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages.Greek; + } + + if (string.Equals(value, MemberIrish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages.Irish; + } + + if (string.Equals(value, MemberTurkish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages.Turkish; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages.Greek: + writer.WriteStringValue(MemberGreek); + break; + case Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages.Irish: + writer.WriteStringValue(MemberIrish); + break; + case Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages.Turkish: + writer.WriteStringValue(MemberTurkish); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguages value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} + internal sealed partial class SnowballLanguageConverter : System.Text.Json.Serialization.JsonConverter { + private static readonly System.Text.Json.JsonEncodedText MemberArabic = System.Text.Json.JsonEncodedText.Encode("Arabic"); private static readonly System.Text.Json.JsonEncodedText MemberArmenian = System.Text.Json.JsonEncodedText.Encode("Armenian"); private static readonly System.Text.Json.JsonEncodedText MemberBasque = System.Text.Json.JsonEncodedText.Encode("Basque"); private static readonly System.Text.Json.JsonEncodedText MemberCatalan = System.Text.Json.JsonEncodedText.Encode("Catalan"); private static readonly System.Text.Json.JsonEncodedText MemberDanish = System.Text.Json.JsonEncodedText.Encode("Danish"); private static readonly System.Text.Json.JsonEncodedText MemberDutch = System.Text.Json.JsonEncodedText.Encode("Dutch"); private static readonly System.Text.Json.JsonEncodedText MemberEnglish = System.Text.Json.JsonEncodedText.Encode("English"); + private static readonly System.Text.Json.JsonEncodedText MemberEstonian = System.Text.Json.JsonEncodedText.Encode("Estonian"); private static readonly System.Text.Json.JsonEncodedText MemberFinnish = System.Text.Json.JsonEncodedText.Encode("Finnish"); private static readonly System.Text.Json.JsonEncodedText MemberFrench = System.Text.Json.JsonEncodedText.Encode("French"); private static readonly System.Text.Json.JsonEncodedText MemberGerman = System.Text.Json.JsonEncodedText.Encode("German"); private static readonly System.Text.Json.JsonEncodedText MemberGerman2 = System.Text.Json.JsonEncodedText.Encode("German2"); private static readonly System.Text.Json.JsonEncodedText MemberHungarian = System.Text.Json.JsonEncodedText.Encode("Hungarian"); + private static readonly System.Text.Json.JsonEncodedText MemberIrish = System.Text.Json.JsonEncodedText.Encode("Irish"); private static readonly System.Text.Json.JsonEncodedText MemberItalian = System.Text.Json.JsonEncodedText.Encode("Italian"); private static readonly System.Text.Json.JsonEncodedText MemberKp = System.Text.Json.JsonEncodedText.Encode("Kp"); + private static readonly System.Text.Json.JsonEncodedText MemberLithuanian = System.Text.Json.JsonEncodedText.Encode("Lithuanian"); private static readonly System.Text.Json.JsonEncodedText MemberLovins = System.Text.Json.JsonEncodedText.Encode("Lovins"); private static readonly System.Text.Json.JsonEncodedText MemberNorwegian = System.Text.Json.JsonEncodedText.Encode("Norwegian"); private static readonly System.Text.Json.JsonEncodedText MemberPorter = System.Text.Json.JsonEncodedText.Encode("Porter"); private static readonly System.Text.Json.JsonEncodedText MemberPortuguese = System.Text.Json.JsonEncodedText.Encode("Portuguese"); private static readonly System.Text.Json.JsonEncodedText MemberRomanian = System.Text.Json.JsonEncodedText.Encode("Romanian"); private static readonly System.Text.Json.JsonEncodedText MemberRussian = System.Text.Json.JsonEncodedText.Encode("Russian"); + private static readonly System.Text.Json.JsonEncodedText MemberSerbian = System.Text.Json.JsonEncodedText.Encode("Serbian"); private static readonly System.Text.Json.JsonEncodedText MemberSpanish = System.Text.Json.JsonEncodedText.Encode("Spanish"); private static readonly System.Text.Json.JsonEncodedText MemberSwedish = System.Text.Json.JsonEncodedText.Encode("Swedish"); private static readonly System.Text.Json.JsonEncodedText MemberTurkish = System.Text.Json.JsonEncodedText.Encode("Turkish"); public override Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { + if (reader.ValueTextEquals(MemberArabic)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Arabic; + } + if (reader.ValueTextEquals(MemberArmenian)) { return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Armenian; @@ -535,6 +616,11 @@ public override Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage Read(ref return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.English; } + if (reader.ValueTextEquals(MemberEstonian)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Estonian; + } + if (reader.ValueTextEquals(MemberFinnish)) { return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Finnish; @@ -560,6 +646,11 @@ public override Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage Read(ref return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Hungarian; } + if (reader.ValueTextEquals(MemberIrish)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Irish; + } + if (reader.ValueTextEquals(MemberItalian)) { return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Italian; @@ -570,6 +661,11 @@ public override Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage Read(ref return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Kp; } + if (reader.ValueTextEquals(MemberLithuanian)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Lithuanian; + } + if (reader.ValueTextEquals(MemberLovins)) { return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Lovins; @@ -600,6 +696,11 @@ public override Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage Read(ref return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Russian; } + if (reader.ValueTextEquals(MemberSerbian)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Serbian; + } + if (reader.ValueTextEquals(MemberSpanish)) { return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Spanish; @@ -616,6 +717,11 @@ public override Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage Read(ref } var value = reader.GetString()!; + if (string.Equals(value, MemberArabic.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Arabic; + } + if (string.Equals(value, MemberArmenian.Value, System.StringComparison.OrdinalIgnoreCase)) { return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Armenian; @@ -646,6 +752,11 @@ public override Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage Read(ref return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.English; } + if (string.Equals(value, MemberEstonian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Estonian; + } + if (string.Equals(value, MemberFinnish.Value, System.StringComparison.OrdinalIgnoreCase)) { return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Finnish; @@ -671,6 +782,11 @@ public override Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage Read(ref return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Hungarian; } + if (string.Equals(value, MemberIrish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Irish; + } + if (string.Equals(value, MemberItalian.Value, System.StringComparison.OrdinalIgnoreCase)) { return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Italian; @@ -681,6 +797,11 @@ public override Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage Read(ref return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Kp; } + if (string.Equals(value, MemberLithuanian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Lithuanian; + } + if (string.Equals(value, MemberLovins.Value, System.StringComparison.OrdinalIgnoreCase)) { return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Lovins; @@ -711,6 +832,11 @@ public override Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage Read(ref return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Russian; } + if (string.Equals(value, MemberSerbian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Serbian; + } + if (string.Equals(value, MemberSpanish.Value, System.StringComparison.OrdinalIgnoreCase)) { return Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Spanish; @@ -733,6 +859,9 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { switch (value) { + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Arabic: + writer.WriteStringValue(MemberArabic); + break; case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Armenian: writer.WriteStringValue(MemberArmenian); break; @@ -751,6 +880,9 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.English: writer.WriteStringValue(MemberEnglish); break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Estonian: + writer.WriteStringValue(MemberEstonian); + break; case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Finnish: writer.WriteStringValue(MemberFinnish); break; @@ -766,12 +898,18 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Hungarian: writer.WriteStringValue(MemberHungarian); break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Irish: + writer.WriteStringValue(MemberIrish); + break; case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Italian: writer.WriteStringValue(MemberItalian); break; case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Kp: writer.WriteStringValue(MemberKp); break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Lithuanian: + writer.WriteStringValue(MemberLithuanian); + break; case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Lovins: writer.WriteStringValue(MemberLovins); break; @@ -790,6 +928,9 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Russian: writer.WriteStringValue(MemberRussian); break; + case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Serbian: + writer.WriteStringValue(MemberSerbian); + break; case Elastic.Clients.Elasticsearch.Analysis.SnowballLanguage.Spanish: writer.WriteStringValue(MemberSpanish); break; @@ -1637,6 +1778,91 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, } } +internal sealed partial class CjkBigramIgnoredScriptConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberHan = System.Text.Json.JsonEncodedText.Encode("han"); + private static readonly System.Text.Json.JsonEncodedText MemberHangul = System.Text.Json.JsonEncodedText.Encode("hangul"); + private static readonly System.Text.Json.JsonEncodedText MemberHiragana = System.Text.Json.JsonEncodedText.Encode("hiragana"); + private static readonly System.Text.Json.JsonEncodedText MemberKatakana = System.Text.Json.JsonEncodedText.Encode("katakana"); + + public override Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberHan)) + { + return Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Han; + } + + if (reader.ValueTextEquals(MemberHangul)) + { + return Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Hangul; + } + + if (reader.ValueTextEquals(MemberHiragana)) + { + return Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Hiragana; + } + + if (reader.ValueTextEquals(MemberKatakana)) + { + return Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Katakana; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberHan.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Han; + } + + if (string.Equals(value, MemberHangul.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Hangul; + } + + if (string.Equals(value, MemberHiragana.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Hiragana; + } + + if (string.Equals(value, MemberKatakana.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Katakana; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Han: + writer.WriteStringValue(MemberHan); + break; + case Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Hangul: + writer.WriteStringValue(MemberHangul); + break; + case Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Hiragana: + writer.WriteStringValue(MemberHiragana); + break; + case Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript.Katakana: + writer.WriteStringValue(MemberKatakana); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScript value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} + internal sealed partial class PhoneticLanguageConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText MemberAny = System.Text.Json.JsonEncodedText.Encode("any"); @@ -1834,6 +2060,553 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, } } +internal sealed partial class StopWordLanguageConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberArabic = System.Text.Json.JsonEncodedText.Encode("_arabic_"); + private static readonly System.Text.Json.JsonEncodedText MemberArmenian = System.Text.Json.JsonEncodedText.Encode("_armenian_"); + private static readonly System.Text.Json.JsonEncodedText MemberBasque = System.Text.Json.JsonEncodedText.Encode("_basque_"); + private static readonly System.Text.Json.JsonEncodedText MemberBengali = System.Text.Json.JsonEncodedText.Encode("_bengali_"); + private static readonly System.Text.Json.JsonEncodedText MemberBrazilian = System.Text.Json.JsonEncodedText.Encode("_brazilian_"); + private static readonly System.Text.Json.JsonEncodedText MemberBulgarian = System.Text.Json.JsonEncodedText.Encode("_bulgarian_"); + private static readonly System.Text.Json.JsonEncodedText MemberCatalan = System.Text.Json.JsonEncodedText.Encode("_catalan_"); + private static readonly System.Text.Json.JsonEncodedText MemberCjk = System.Text.Json.JsonEncodedText.Encode("_cjk_"); + private static readonly System.Text.Json.JsonEncodedText MemberCzech = System.Text.Json.JsonEncodedText.Encode("_czech_"); + private static readonly System.Text.Json.JsonEncodedText MemberDanish = System.Text.Json.JsonEncodedText.Encode("_danish_"); + private static readonly System.Text.Json.JsonEncodedText MemberDutch = System.Text.Json.JsonEncodedText.Encode("_dutch_"); + private static readonly System.Text.Json.JsonEncodedText MemberEnglish = System.Text.Json.JsonEncodedText.Encode("_english_"); + private static readonly System.Text.Json.JsonEncodedText MemberEstonian = System.Text.Json.JsonEncodedText.Encode("_estonian_"); + private static readonly System.Text.Json.JsonEncodedText MemberFinnish = System.Text.Json.JsonEncodedText.Encode("_finnish_"); + private static readonly System.Text.Json.JsonEncodedText MemberFrench = System.Text.Json.JsonEncodedText.Encode("_french_"); + private static readonly System.Text.Json.JsonEncodedText MemberGalician = System.Text.Json.JsonEncodedText.Encode("_galician_"); + private static readonly System.Text.Json.JsonEncodedText MemberGerman = System.Text.Json.JsonEncodedText.Encode("_german_"); + private static readonly System.Text.Json.JsonEncodedText MemberGreek = System.Text.Json.JsonEncodedText.Encode("_greek_"); + private static readonly System.Text.Json.JsonEncodedText MemberHindi = System.Text.Json.JsonEncodedText.Encode("_hindi_"); + private static readonly System.Text.Json.JsonEncodedText MemberHungarian = System.Text.Json.JsonEncodedText.Encode("_hungarian_"); + private static readonly System.Text.Json.JsonEncodedText MemberIndonesian = System.Text.Json.JsonEncodedText.Encode("_indonesian_"); + private static readonly System.Text.Json.JsonEncodedText MemberIrish = System.Text.Json.JsonEncodedText.Encode("_irish_"); + private static readonly System.Text.Json.JsonEncodedText MemberItalian = System.Text.Json.JsonEncodedText.Encode("_italian_"); + private static readonly System.Text.Json.JsonEncodedText MemberLatvian = System.Text.Json.JsonEncodedText.Encode("_latvian_"); + private static readonly System.Text.Json.JsonEncodedText MemberLithuanian = System.Text.Json.JsonEncodedText.Encode("_lithuanian_"); + private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("_none_"); + private static readonly System.Text.Json.JsonEncodedText MemberNorwegian = System.Text.Json.JsonEncodedText.Encode("_norwegian_"); + private static readonly System.Text.Json.JsonEncodedText MemberPersian = System.Text.Json.JsonEncodedText.Encode("_persian_"); + private static readonly System.Text.Json.JsonEncodedText MemberPortuguese = System.Text.Json.JsonEncodedText.Encode("_portuguese_"); + private static readonly System.Text.Json.JsonEncodedText MemberRomanian = System.Text.Json.JsonEncodedText.Encode("_romanian_"); + private static readonly System.Text.Json.JsonEncodedText MemberRussian = System.Text.Json.JsonEncodedText.Encode("_russian_"); + private static readonly System.Text.Json.JsonEncodedText MemberSerbian = System.Text.Json.JsonEncodedText.Encode("_serbian_"); + private static readonly System.Text.Json.JsonEncodedText MemberSorani = System.Text.Json.JsonEncodedText.Encode("_sorani_"); + private static readonly System.Text.Json.JsonEncodedText MemberSpanish = System.Text.Json.JsonEncodedText.Encode("_spanish_"); + private static readonly System.Text.Json.JsonEncodedText MemberSwedish = System.Text.Json.JsonEncodedText.Encode("_swedish_"); + private static readonly System.Text.Json.JsonEncodedText MemberThai = System.Text.Json.JsonEncodedText.Encode("_thai_"); + private static readonly System.Text.Json.JsonEncodedText MemberTurkish = System.Text.Json.JsonEncodedText.Encode("_turkish_"); + + public override Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberArabic)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Arabic; + } + + if (reader.ValueTextEquals(MemberArmenian)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Armenian; + } + + if (reader.ValueTextEquals(MemberBasque)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Basque; + } + + if (reader.ValueTextEquals(MemberBengali)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Bengali; + } + + if (reader.ValueTextEquals(MemberBrazilian)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Brazilian; + } + + if (reader.ValueTextEquals(MemberBulgarian)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Bulgarian; + } + + if (reader.ValueTextEquals(MemberCatalan)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Catalan; + } + + if (reader.ValueTextEquals(MemberCjk)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Cjk; + } + + if (reader.ValueTextEquals(MemberCzech)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Czech; + } + + if (reader.ValueTextEquals(MemberDanish)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Danish; + } + + if (reader.ValueTextEquals(MemberDutch)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Dutch; + } + + if (reader.ValueTextEquals(MemberEnglish)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.English; + } + + if (reader.ValueTextEquals(MemberEstonian)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Estonian; + } + + if (reader.ValueTextEquals(MemberFinnish)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Finnish; + } + + if (reader.ValueTextEquals(MemberFrench)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.French; + } + + if (reader.ValueTextEquals(MemberGalician)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Galician; + } + + if (reader.ValueTextEquals(MemberGerman)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.German; + } + + if (reader.ValueTextEquals(MemberGreek)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Greek; + } + + if (reader.ValueTextEquals(MemberHindi)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Hindi; + } + + if (reader.ValueTextEquals(MemberHungarian)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Hungarian; + } + + if (reader.ValueTextEquals(MemberIndonesian)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Indonesian; + } + + if (reader.ValueTextEquals(MemberIrish)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Irish; + } + + if (reader.ValueTextEquals(MemberItalian)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Italian; + } + + if (reader.ValueTextEquals(MemberLatvian)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Latvian; + } + + if (reader.ValueTextEquals(MemberLithuanian)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Lithuanian; + } + + if (reader.ValueTextEquals(MemberNone)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.None; + } + + if (reader.ValueTextEquals(MemberNorwegian)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Norwegian; + } + + if (reader.ValueTextEquals(MemberPersian)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Persian; + } + + if (reader.ValueTextEquals(MemberPortuguese)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Portuguese; + } + + if (reader.ValueTextEquals(MemberRomanian)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Romanian; + } + + if (reader.ValueTextEquals(MemberRussian)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Russian; + } + + if (reader.ValueTextEquals(MemberSerbian)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Serbian; + } + + if (reader.ValueTextEquals(MemberSorani)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Sorani; + } + + if (reader.ValueTextEquals(MemberSpanish)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Spanish; + } + + if (reader.ValueTextEquals(MemberSwedish)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Swedish; + } + + if (reader.ValueTextEquals(MemberThai)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Thai; + } + + if (reader.ValueTextEquals(MemberTurkish)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Turkish; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberArabic.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Arabic; + } + + if (string.Equals(value, MemberArmenian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Armenian; + } + + if (string.Equals(value, MemberBasque.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Basque; + } + + if (string.Equals(value, MemberBengali.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Bengali; + } + + if (string.Equals(value, MemberBrazilian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Brazilian; + } + + if (string.Equals(value, MemberBulgarian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Bulgarian; + } + + if (string.Equals(value, MemberCatalan.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Catalan; + } + + if (string.Equals(value, MemberCjk.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Cjk; + } + + if (string.Equals(value, MemberCzech.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Czech; + } + + if (string.Equals(value, MemberDanish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Danish; + } + + if (string.Equals(value, MemberDutch.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Dutch; + } + + if (string.Equals(value, MemberEnglish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.English; + } + + if (string.Equals(value, MemberEstonian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Estonian; + } + + if (string.Equals(value, MemberFinnish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Finnish; + } + + if (string.Equals(value, MemberFrench.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.French; + } + + if (string.Equals(value, MemberGalician.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Galician; + } + + if (string.Equals(value, MemberGerman.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.German; + } + + if (string.Equals(value, MemberGreek.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Greek; + } + + if (string.Equals(value, MemberHindi.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Hindi; + } + + if (string.Equals(value, MemberHungarian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Hungarian; + } + + if (string.Equals(value, MemberIndonesian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Indonesian; + } + + if (string.Equals(value, MemberIrish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Irish; + } + + if (string.Equals(value, MemberItalian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Italian; + } + + if (string.Equals(value, MemberLatvian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Latvian; + } + + if (string.Equals(value, MemberLithuanian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Lithuanian; + } + + if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.None; + } + + if (string.Equals(value, MemberNorwegian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Norwegian; + } + + if (string.Equals(value, MemberPersian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Persian; + } + + if (string.Equals(value, MemberPortuguese.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Portuguese; + } + + if (string.Equals(value, MemberRomanian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Romanian; + } + + if (string.Equals(value, MemberRussian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Russian; + } + + if (string.Equals(value, MemberSerbian.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Serbian; + } + + if (string.Equals(value, MemberSorani.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Sorani; + } + + if (string.Equals(value, MemberSpanish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Spanish; + } + + if (string.Equals(value, MemberSwedish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Swedish; + } + + if (string.Equals(value, MemberThai.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Thai; + } + + if (string.Equals(value, MemberTurkish.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Turkish; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Arabic: + writer.WriteStringValue(MemberArabic); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Armenian: + writer.WriteStringValue(MemberArmenian); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Basque: + writer.WriteStringValue(MemberBasque); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Bengali: + writer.WriteStringValue(MemberBengali); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Brazilian: + writer.WriteStringValue(MemberBrazilian); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Bulgarian: + writer.WriteStringValue(MemberBulgarian); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Catalan: + writer.WriteStringValue(MemberCatalan); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Cjk: + writer.WriteStringValue(MemberCjk); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Czech: + writer.WriteStringValue(MemberCzech); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Danish: + writer.WriteStringValue(MemberDanish); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Dutch: + writer.WriteStringValue(MemberDutch); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.English: + writer.WriteStringValue(MemberEnglish); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Estonian: + writer.WriteStringValue(MemberEstonian); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Finnish: + writer.WriteStringValue(MemberFinnish); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.French: + writer.WriteStringValue(MemberFrench); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Galician: + writer.WriteStringValue(MemberGalician); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.German: + writer.WriteStringValue(MemberGerman); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Greek: + writer.WriteStringValue(MemberGreek); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Hindi: + writer.WriteStringValue(MemberHindi); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Hungarian: + writer.WriteStringValue(MemberHungarian); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Indonesian: + writer.WriteStringValue(MemberIndonesian); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Irish: + writer.WriteStringValue(MemberIrish); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Italian: + writer.WriteStringValue(MemberItalian); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Latvian: + writer.WriteStringValue(MemberLatvian); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Lithuanian: + writer.WriteStringValue(MemberLithuanian); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.None: + writer.WriteStringValue(MemberNone); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Norwegian: + writer.WriteStringValue(MemberNorwegian); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Persian: + writer.WriteStringValue(MemberPersian); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Portuguese: + writer.WriteStringValue(MemberPortuguese); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Romanian: + writer.WriteStringValue(MemberRomanian); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Russian: + writer.WriteStringValue(MemberRussian); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Serbian: + writer.WriteStringValue(MemberSerbian); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Sorani: + writer.WriteStringValue(MemberSorani); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Spanish: + writer.WriteStringValue(MemberSpanish); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Swedish: + writer.WriteStringValue(MemberSwedish); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Thai: + writer.WriteStringValue(MemberThai); + break; + case Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage.Turkish: + writer.WriteStringValue(MemberTurkish); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.StopWordLanguage value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} + [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationModeConverter))] public enum KuromojiTokenizationMode { @@ -1905,9 +2678,22 @@ public enum KeepTypesMode Include } +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.LowercaseTokenFilterLanguagesConverter))] +public enum LowercaseTokenFilterLanguages +{ + [System.Runtime.Serialization.EnumMember(Value = "greek")] + Greek, + [System.Runtime.Serialization.EnumMember(Value = "irish")] + Irish, + [System.Runtime.Serialization.EnumMember(Value = "turkish")] + Turkish +} + [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.SnowballLanguageConverter))] public enum SnowballLanguage { + [System.Runtime.Serialization.EnumMember(Value = "Arabic")] + Arabic, [System.Runtime.Serialization.EnumMember(Value = "Armenian")] Armenian, [System.Runtime.Serialization.EnumMember(Value = "Basque")] @@ -1920,6 +2706,8 @@ public enum SnowballLanguage Dutch, [System.Runtime.Serialization.EnumMember(Value = "English")] English, + [System.Runtime.Serialization.EnumMember(Value = "Estonian")] + Estonian, [System.Runtime.Serialization.EnumMember(Value = "Finnish")] Finnish, [System.Runtime.Serialization.EnumMember(Value = "French")] @@ -1930,10 +2718,14 @@ public enum SnowballLanguage German2, [System.Runtime.Serialization.EnumMember(Value = "Hungarian")] Hungarian, + [System.Runtime.Serialization.EnumMember(Value = "Irish")] + Irish, [System.Runtime.Serialization.EnumMember(Value = "Italian")] Italian, [System.Runtime.Serialization.EnumMember(Value = "Kp")] Kp, + [System.Runtime.Serialization.EnumMember(Value = "Lithuanian")] + Lithuanian, [System.Runtime.Serialization.EnumMember(Value = "Lovins")] Lovins, [System.Runtime.Serialization.EnumMember(Value = "Norwegian")] @@ -1946,6 +2738,8 @@ public enum SnowballLanguage Romanian, [System.Runtime.Serialization.EnumMember(Value = "Russian")] Russian, + [System.Runtime.Serialization.EnumMember(Value = "Serbian")] + Serbian, [System.Runtime.Serialization.EnumMember(Value = "Spanish")] Spanish, [System.Runtime.Serialization.EnumMember(Value = "Swedish")] @@ -2080,6 +2874,19 @@ public enum TokenChar Whitespace } +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.CjkBigramIgnoredScriptConverter))] +public enum CjkBigramIgnoredScript +{ + [System.Runtime.Serialization.EnumMember(Value = "han")] + Han, + [System.Runtime.Serialization.EnumMember(Value = "hangul")] + Hangul, + [System.Runtime.Serialization.EnumMember(Value = "hiragana")] + Hiragana, + [System.Runtime.Serialization.EnumMember(Value = "katakana")] + Katakana +} + [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.PhoneticLanguageConverter))] public enum PhoneticLanguage { @@ -2107,4 +2914,83 @@ public enum PhoneticLanguage Russian, [System.Runtime.Serialization.EnumMember(Value = "spanish")] Spanish +} + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.StopWordLanguageConverter))] +public enum StopWordLanguage +{ + [System.Runtime.Serialization.EnumMember(Value = "_arabic_")] + Arabic, + [System.Runtime.Serialization.EnumMember(Value = "_armenian_")] + Armenian, + [System.Runtime.Serialization.EnumMember(Value = "_basque_")] + Basque, + [System.Runtime.Serialization.EnumMember(Value = "_bengali_")] + Bengali, + [System.Runtime.Serialization.EnumMember(Value = "_brazilian_")] + Brazilian, + [System.Runtime.Serialization.EnumMember(Value = "_bulgarian_")] + Bulgarian, + [System.Runtime.Serialization.EnumMember(Value = "_catalan_")] + Catalan, + [System.Runtime.Serialization.EnumMember(Value = "_cjk_")] + Cjk, + [System.Runtime.Serialization.EnumMember(Value = "_czech_")] + Czech, + [System.Runtime.Serialization.EnumMember(Value = "_danish_")] + Danish, + [System.Runtime.Serialization.EnumMember(Value = "_dutch_")] + Dutch, + [System.Runtime.Serialization.EnumMember(Value = "_english_")] + English, + [System.Runtime.Serialization.EnumMember(Value = "_estonian_")] + Estonian, + [System.Runtime.Serialization.EnumMember(Value = "_finnish_")] + Finnish, + [System.Runtime.Serialization.EnumMember(Value = "_french_")] + French, + [System.Runtime.Serialization.EnumMember(Value = "_galician_")] + Galician, + [System.Runtime.Serialization.EnumMember(Value = "_german_")] + German, + [System.Runtime.Serialization.EnumMember(Value = "_greek_")] + Greek, + [System.Runtime.Serialization.EnumMember(Value = "_hindi_")] + Hindi, + [System.Runtime.Serialization.EnumMember(Value = "_hungarian_")] + Hungarian, + [System.Runtime.Serialization.EnumMember(Value = "_indonesian_")] + Indonesian, + [System.Runtime.Serialization.EnumMember(Value = "_irish_")] + Irish, + [System.Runtime.Serialization.EnumMember(Value = "_italian_")] + Italian, + [System.Runtime.Serialization.EnumMember(Value = "_latvian_")] + Latvian, + [System.Runtime.Serialization.EnumMember(Value = "_lithuanian_")] + Lithuanian, + [System.Runtime.Serialization.EnumMember(Value = "_none_")] + None, + [System.Runtime.Serialization.EnumMember(Value = "_norwegian_")] + Norwegian, + [System.Runtime.Serialization.EnumMember(Value = "_persian_")] + Persian, + [System.Runtime.Serialization.EnumMember(Value = "_portuguese_")] + Portuguese, + [System.Runtime.Serialization.EnumMember(Value = "_romanian_")] + Romanian, + [System.Runtime.Serialization.EnumMember(Value = "_russian_")] + Russian, + [System.Runtime.Serialization.EnumMember(Value = "_serbian_")] + Serbian, + [System.Runtime.Serialization.EnumMember(Value = "_sorani_")] + Sorani, + [System.Runtime.Serialization.EnumMember(Value = "_spanish_")] + Spanish, + [System.Runtime.Serialization.EnumMember(Value = "_swedish_")] + Swedish, + [System.Runtime.Serialization.EnumMember(Value = "_thai_")] + Thai, + [System.Runtime.Serialization.EnumMember(Value = "_turkish_")] + Turkish } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Ingest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Ingest.g.cs index c3e9699e9b..fdd2917d26 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Ingest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Ingest.g.cs @@ -604,6 +604,105 @@ public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, } } +internal sealed partial class PipelineSimulationStatusOptionsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberDropped = System.Text.Json.JsonEncodedText.Encode("dropped"); + private static readonly System.Text.Json.JsonEncodedText MemberError = System.Text.Json.JsonEncodedText.Encode("error"); + private static readonly System.Text.Json.JsonEncodedText MemberErrorIgnored = System.Text.Json.JsonEncodedText.Encode("error_ignored"); + private static readonly System.Text.Json.JsonEncodedText MemberSkipped = System.Text.Json.JsonEncodedText.Encode("skipped"); + private static readonly System.Text.Json.JsonEncodedText MemberSuccess = System.Text.Json.JsonEncodedText.Encode("success"); + + public override Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberDropped)) + { + return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Dropped; + } + + if (reader.ValueTextEquals(MemberError)) + { + return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Error; + } + + if (reader.ValueTextEquals(MemberErrorIgnored)) + { + return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.ErrorIgnored; + } + + if (reader.ValueTextEquals(MemberSkipped)) + { + return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Skipped; + } + + if (reader.ValueTextEquals(MemberSuccess)) + { + return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Success; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberDropped.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Dropped; + } + + if (string.Equals(value, MemberError.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Error; + } + + if (string.Equals(value, MemberErrorIgnored.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.ErrorIgnored; + } + + if (string.Equals(value, MemberSkipped.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Skipped; + } + + if (string.Equals(value, MemberSuccess.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Success; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Dropped: + writer.WriteStringValue(MemberDropped); + break; + case Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Error: + writer.WriteStringValue(MemberError); + break; + case Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.ErrorIgnored: + writer.WriteStringValue(MemberErrorIgnored); + break; + case Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Skipped: + writer.WriteStringValue(MemberSkipped); + break; + case Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions.Success: + writer.WriteStringValue(MemberSuccess); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} + [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.ShapeTypeConverter))] public enum ShapeType { @@ -701,4 +800,19 @@ public enum UserAgentProperty Os, [System.Runtime.Serialization.EnumMember(Value = "version")] Version +} + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptionsConverter))] +public enum PipelineSimulationStatusOptions +{ + [System.Runtime.Serialization.EnumMember(Value = "dropped")] + Dropped, + [System.Runtime.Serialization.EnumMember(Value = "error")] + Error, + [System.Runtime.Serialization.EnumMember(Value = "error_ignored")] + ErrorIgnored, + [System.Runtime.Serialization.EnumMember(Value = "skipped")] + Skipped, + [System.Runtime.Serialization.EnumMember(Value = "success")] + Success } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Watcher.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Watcher.g.cs deleted file mode 100644 index 32ec544f19..0000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Watcher.g.cs +++ /dev/null @@ -1,122 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using System; -using System.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.Watcher; - -internal sealed partial class ActionStatusOptionsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText MemberFailure = System.Text.Json.JsonEncodedText.Encode("failure"); - private static readonly System.Text.Json.JsonEncodedText MemberSimulated = System.Text.Json.JsonEncodedText.Encode("simulated"); - private static readonly System.Text.Json.JsonEncodedText MemberSuccess = System.Text.Json.JsonEncodedText.Encode("success"); - private static readonly System.Text.Json.JsonEncodedText MemberThrottled = System.Text.Json.JsonEncodedText.Encode("throttled"); - - public override Elastic.Clients.Elasticsearch.Watcher.ActionStatusOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - if (reader.ValueTextEquals(MemberFailure)) - { - return Elastic.Clients.Elasticsearch.Watcher.ActionStatusOptions.Failure; - } - - if (reader.ValueTextEquals(MemberSimulated)) - { - return Elastic.Clients.Elasticsearch.Watcher.ActionStatusOptions.Simulated; - } - - if (reader.ValueTextEquals(MemberSuccess)) - { - return Elastic.Clients.Elasticsearch.Watcher.ActionStatusOptions.Success; - } - - if (reader.ValueTextEquals(MemberThrottled)) - { - return Elastic.Clients.Elasticsearch.Watcher.ActionStatusOptions.Throttled; - } - - var value = reader.GetString()!; - if (string.Equals(value, MemberFailure.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Watcher.ActionStatusOptions.Failure; - } - - if (string.Equals(value, MemberSimulated.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Watcher.ActionStatusOptions.Simulated; - } - - if (string.Equals(value, MemberSuccess.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Watcher.ActionStatusOptions.Success; - } - - if (string.Equals(value, MemberThrottled.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.Watcher.ActionStatusOptions.Throttled; - } - - throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Watcher.ActionStatusOptions)}'."); - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Watcher.ActionStatusOptions value, System.Text.Json.JsonSerializerOptions options) - { - switch (value) - { - case Elastic.Clients.Elasticsearch.Watcher.ActionStatusOptions.Failure: - writer.WriteStringValue(MemberFailure); - break; - case Elastic.Clients.Elasticsearch.Watcher.ActionStatusOptions.Simulated: - writer.WriteStringValue(MemberSimulated); - break; - case Elastic.Clients.Elasticsearch.Watcher.ActionStatusOptions.Success: - writer.WriteStringValue(MemberSuccess); - break; - case Elastic.Clients.Elasticsearch.Watcher.ActionStatusOptions.Throttled: - writer.WriteStringValue(MemberThrottled); - break; - default: - throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Watcher.ActionStatusOptions)}'."); - } - } - - public override Elastic.Clients.Elasticsearch.Watcher.ActionStatusOptions ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - return Read(ref reader, typeToConvert, options); - } - - public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Watcher.ActionStatusOptions value, System.Text.Json.JsonSerializerOptions options) - { - Write(writer, value, options); - } -} - -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Watcher.ActionStatusOptionsConverter))] -public enum ActionStatusOptions -{ - [System.Runtime.Serialization.EnumMember(Value = "failure")] - Failure, - [System.Runtime.Serialization.EnumMember(Value = "simulated")] - Simulated, - [System.Runtime.Serialization.EnumMember(Value = "success")] - Success, - [System.Runtime.Serialization.EnumMember(Value = "throttled")] - Throttled -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestChatCompletion.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestChatCompletion.g.cs index cd750ae21f..84311acadd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestChatCompletion.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestChatCompletion.g.cs @@ -160,6 +160,8 @@ internal RequestChatCompletion(Elastic.Clients.Elasticsearch.Serialization.JsonC /// /// /// A list of objects representing the conversation. + /// Requests should generally only add new messages from the user (role user). + /// The other message roles (assistant, system, or tool) should generally only be copied from the response to a previous completion request, such that the messages array is built up throughout a conversation. /// /// public @@ -244,6 +246,8 @@ public Elastic.Clients.Elasticsearch.Inference.RequestChatCompletionDescriptor M /// /// /// A list of objects representing the conversation. + /// Requests should generally only add new messages from the user (role user). + /// The other message roles (assistant, system, or tool) should generally only be copied from the response to a previous completion request, such that the messages array is built up throughout a conversation. /// /// public Elastic.Clients.Elasticsearch.Inference.RequestChatCompletionDescriptor Messages(System.Collections.Generic.ICollection value) @@ -255,6 +259,8 @@ public Elastic.Clients.Elasticsearch.Inference.RequestChatCompletionDescriptor M /// /// /// A list of objects representing the conversation. + /// Requests should generally only add new messages from the user (role user). + /// The other message roles (assistant, system, or tool) should generally only be copied from the response to a previous completion request, such that the messages array is built up throughout a conversation. /// /// public Elastic.Clients.Elasticsearch.Inference.RequestChatCompletionDescriptor Messages(params Elastic.Clients.Elasticsearch.Inference.Message[] values) @@ -266,6 +272,8 @@ public Elastic.Clients.Elasticsearch.Inference.RequestChatCompletionDescriptor M /// /// /// A list of objects representing the conversation. + /// Requests should generally only add new messages from the user (role user). + /// The other message roles (assistant, system, or tool) should generally only be copied from the response to a previous completion request, such that the messages array is built up throughout a conversation. /// /// public Elastic.Clients.Elasticsearch.Inference.RequestChatCompletionDescriptor Messages(params System.Action[] actions) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineSimulation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineProcessorResult.g.cs similarity index 82% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineSimulation.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineProcessorResult.g.cs index 85983254ee..7e31e8e328 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineSimulation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/PipelineProcessorResult.g.cs @@ -23,7 +23,7 @@ namespace Elastic.Clients.Elasticsearch.Ingest; -internal sealed partial class PipelineSimulationConverter : System.Text.Json.Serialization.JsonConverter +internal sealed partial class PipelineProcessorResultConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropDescription = System.Text.Json.JsonEncodedText.Encode("description"); private static readonly System.Text.Json.JsonEncodedText PropDoc = System.Text.Json.JsonEncodedText.Encode("doc"); @@ -33,7 +33,7 @@ internal sealed partial class PipelineSimulationConverter : System.Text.Json.Ser private static readonly System.Text.Json.JsonEncodedText PropStatus = System.Text.Json.JsonEncodedText.Encode("status"); private static readonly System.Text.Json.JsonEncodedText PropTag = System.Text.Json.JsonEncodedText.Encode("tag"); - public override Elastic.Clients.Elasticsearch.Ingest.PipelineSimulation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + public override Elastic.Clients.Elasticsearch.Ingest.PipelineProcessorResult Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propDescription = default; @@ -41,7 +41,7 @@ public override Elastic.Clients.Elasticsearch.Ingest.PipelineSimulation Read(ref LocalJsonValue propError = default; LocalJsonValue propIgnoredError = default; LocalJsonValue propProcessorType = default; - LocalJsonValue propStatus = default; + LocalJsonValue propStatus = default; LocalJsonValue propTag = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -90,7 +90,7 @@ public override Elastic.Clients.Elasticsearch.Ingest.PipelineSimulation Read(ref } reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Ingest.PipelineSimulation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + return new Elastic.Clients.Elasticsearch.Ingest.PipelineProcessorResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Description = propDescription.Value, Doc = propDoc.Value, @@ -102,7 +102,7 @@ public override Elastic.Clients.Elasticsearch.Ingest.PipelineSimulation Read(ref }; } - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.PipelineSimulation value, System.Text.Json.JsonSerializerOptions options) + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Ingest.PipelineProcessorResult value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); writer.WriteProperty(options, PropDescription, value.Description, null, null); @@ -116,21 +116,21 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien } } -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationConverter))] -public sealed partial class PipelineSimulation +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Ingest.PipelineProcessorResultConverter))] +public sealed partial class PipelineProcessorResult { #if NET7_0_OR_GREATER - public PipelineSimulation() + public PipelineProcessorResult() { } #endif #if !NET7_0_OR_GREATER - public PipelineSimulation() + public PipelineProcessorResult() { } #endif [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - internal PipelineSimulation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + internal PipelineProcessorResult(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) { _ = sentinel; } @@ -140,6 +140,6 @@ internal PipelineSimulation(Elastic.Clients.Elasticsearch.Serialization.JsonCons public Elastic.Clients.Elasticsearch.ErrorCause? Error { get; set; } public Elastic.Clients.Elasticsearch.ErrorCause? IgnoredError { get; set; } public string? ProcessorType { get; set; } - public Elastic.Clients.Elasticsearch.Watcher.ActionStatusOptions? Status { get; set; } + public Elastic.Clients.Elasticsearch.Ingest.PipelineSimulationStatusOptions? Status { get; set; } public string? Tag { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SimulateDocumentResult.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SimulateDocumentResult.g.cs index 9925fa0b5f..c2d9212401 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SimulateDocumentResult.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Ingest/SimulateDocumentResult.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Ingest.SimulateDocumentResult Read reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propDoc = default; LocalJsonValue propError = default; - LocalJsonValue?> propProcessorResults = default; + LocalJsonValue?> propProcessorResults = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propDoc.TryReadProperty(ref reader, options, PropDoc, null)) @@ -47,7 +47,7 @@ public override Elastic.Clients.Elasticsearch.Ingest.SimulateDocumentResult Read continue; } - if (propProcessorResults.TryReadProperty(ref reader, options, PropProcessorResults, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + if (propProcessorResults.TryReadProperty(ref reader, options, PropProcessorResults, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) { continue; } @@ -75,7 +75,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteStartObject(); writer.WriteProperty(options, PropDoc, value.Doc, null, null); writer.WriteProperty(options, PropError, value.Error, null, null); - writer.WriteProperty(options, PropProcessorResults, value.ProcessorResults, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropProcessorResults, value.ProcessorResults, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); writer.WriteEndObject(); } } @@ -101,5 +101,5 @@ internal SimulateDocumentResult(Elastic.Clients.Elasticsearch.Serialization.Json public Elastic.Clients.Elasticsearch.Ingest.DocumentSimulation? Doc { get; set; } public Elastic.Clients.Elasticsearch.ErrorCause? Error { get; set; } - public System.Collections.Generic.IReadOnlyCollection? ProcessorResults { get; set; } + public System.Collections.Generic.IReadOnlyCollection? ProcessorResults { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MoreLikeThisQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MoreLikeThisQuery.g.cs index 328455dacb..4e3aa59ecc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MoreLikeThisQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MoreLikeThisQuery.g.cs @@ -65,7 +65,7 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.MoreLikeThisQuery Read(re LocalJsonValue propMinWordLength = default; LocalJsonValue propQueryName = default; LocalJsonValue propRouting = default; - LocalJsonValue?> propStopWords = default; + LocalJsonValue>?> propStopWords = default; LocalJsonValue?> propUnlike = default; LocalJsonValue propVersion = default; LocalJsonValue propVersionType = default; @@ -151,7 +151,7 @@ public override Elastic.Clients.Elasticsearch.QueryDsl.MoreLikeThisQuery Read(re continue; } - if (propStopWords.TryReadProperty(ref reader, options, PropStopWords, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + if (propStopWords.TryReadProperty(ref reader, options, PropStopWords, static Elastic.Clients.Elasticsearch.Union>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartArray), null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -225,7 +225,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropMinWordLength, value.MinWordLength, null, null); writer.WriteProperty(options, PropQueryName, value.QueryName, null, null); writer.WriteProperty(options, PropRouting, value.Routing, null, null); - writer.WriteProperty(options, PropStopWords, value.StopWords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropStopWords, value.StopWords, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropUnlike, value.Unlike, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); writer.WriteProperty(options, PropVersion, value.Version, null, null); writer.WriteProperty(options, PropVersionType, value.VersionType, null, null); @@ -376,7 +376,7 @@ internal MoreLikeThisQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// Any word in this set is ignored. /// /// - public System.Collections.Generic.ICollection? StopWords { get; set; } + public Elastic.Clients.Elasticsearch.Union>? StopWords { get; set; } /// /// @@ -627,24 +627,12 @@ public Elastic.Clients.Elasticsearch.QueryDsl.MoreLikeThisQueryDescriptor /// - public Elastic.Clients.Elasticsearch.QueryDsl.MoreLikeThisQueryDescriptor StopWords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.QueryDsl.MoreLikeThisQueryDescriptor StopWords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.StopWords = value; return this; } - /// - /// - /// An array of stop words. - /// Any word in this set is ignored. - /// - /// - public Elastic.Clients.Elasticsearch.QueryDsl.MoreLikeThisQueryDescriptor StopWords(params string[] values) - { - Instance.StopWords = [.. values]; - return this; - } - /// /// /// Used in combination with like to exclude documents that match a set of terms. @@ -961,24 +949,12 @@ public Elastic.Clients.Elasticsearch.QueryDsl.MoreLikeThisQueryDescriptor Routin /// Any word in this set is ignored. /// /// - public Elastic.Clients.Elasticsearch.QueryDsl.MoreLikeThisQueryDescriptor StopWords(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.QueryDsl.MoreLikeThisQueryDescriptor StopWords(Elastic.Clients.Elasticsearch.Union>? value) { Instance.StopWords = value; return this; } - /// - /// - /// An array of stop words. - /// Any word in this set is ignored. - /// - /// - public Elastic.Clients.Elasticsearch.QueryDsl.MoreLikeThisQueryDescriptor StopWords(params string[] values) - { - Instance.StopWords = [.. values]; - return this; - } - /// /// /// Used in combination with like to exclude documents that match a set of terms.