diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateResponse.Converters.g.cs index 91f44975881..c611d813c1a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateResponse.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateResponse.Converters.g.cs @@ -31,6 +31,7 @@ public sealed partial class TranslateResponseConverter : System.Text.Json.Serial private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source"); + private static readonly System.Text.Json.JsonEncodedText PropTrackTotalHits = System.Text.Json.JsonEncodedText.Encode("track_total_hits"); public override Elastic.Clients.Elasticsearch.Sql.TranslateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { @@ -41,6 +42,7 @@ public override Elastic.Clients.Elasticsearch.Sql.TranslateResponse Read(ref Sys LocalJsonValue propSize = default; LocalJsonValue?> propSort = default; LocalJsonValue propSource = default; + LocalJsonValue propTrackTotalHits = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) @@ -73,6 +75,11 @@ public override Elastic.Clients.Elasticsearch.Sql.TranslateResponse Read(ref Sys continue; } + if (propTrackTotalHits.TryReadProperty(ref reader, options, PropTrackTotalHits, null)) + { + continue; + } + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) { reader.SafeSkip(); @@ -90,7 +97,8 @@ public override Elastic.Clients.Elasticsearch.Sql.TranslateResponse Read(ref Sys Query = propQuery.Value, Size = propSize.Value, Sort = propSort.Value, - Source = propSource.Value + Source = propSource.Value, + TrackTotalHits = propTrackTotalHits.Value }; } @@ -103,6 +111,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropSort, value.Sort, 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, PropSource, value.Source, null, null); + writer.WriteProperty(options, PropTrackTotalHits, value.TrackTotalHits, null, null); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateResponse.g.cs index 2da5d5dfafd..0e0c13697b3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateResponse.g.cs @@ -43,4 +43,5 @@ internal TranslateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConst public long? Size { get; set; } public System.Collections.Generic.ICollection? Sort { get; set; } public Elastic.Clients.Elasticsearch.Core.Search.SourceConfig? Source { get; set; } + public Elastic.Clients.Elasticsearch.Core.Search.TrackHits? TrackTotalHits { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextProperty.Converters.g.cs index e35d5722f90..6b84904cae4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextProperty.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextProperty.Converters.g.cs @@ -26,6 +26,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping.Json; public sealed partial class SemanticTextPropertyConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); private static readonly System.Text.Json.JsonEncodedText PropIndexOptions = System.Text.Json.JsonEncodedText.Encode("index_options"); private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); @@ -36,6 +37,7 @@ public override Elastic.Clients.Elasticsearch.Mapping.SemanticTextProperty Read( { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propChunkingSettings = default; + LocalJsonValue propFields = default; LocalJsonValue propIndexOptions = default; LocalJsonValue propInferenceId = default; LocalJsonValue?> propMeta = default; @@ -47,6 +49,11 @@ public override Elastic.Clients.Elasticsearch.Mapping.SemanticTextProperty Read( continue; } + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + if (propIndexOptions.TryReadProperty(ref reader, options, PropIndexOptions, null)) { continue; @@ -86,6 +93,7 @@ public override Elastic.Clients.Elasticsearch.Mapping.SemanticTextProperty Read( return new Elastic.Clients.Elasticsearch.Mapping.SemanticTextProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { ChunkingSettings = propChunkingSettings.Value, + Fields = propFields.Value, IndexOptions = propIndexOptions.Value, InferenceId = propInferenceId.Value, Meta = propMeta.Value, @@ -97,6 +105,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropFields, value.Fields, null, null); writer.WriteProperty(options, PropIndexOptions, value.IndexOptions, null, null); writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextProperty.g.cs index da57911ed4d..dba2d7d73b4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextProperty.g.cs @@ -51,6 +51,14 @@ internal SemanticTextProperty(Elastic.Clients.Elasticsearch.Serialization.JsonCo /// public Elastic.Clients.Elasticsearch.Mapping.ChunkingSettings? ChunkingSettings { get; set; } + /// + /// + /// Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one + /// field for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers. + /// + /// + public Elastic.Clients.Elasticsearch.Mapping.Properties? Fields { get; set; } + /// /// /// Settings for index_options that override any defaults used by semantic_text, for example @@ -126,6 +134,30 @@ public Elastic.Clients.Elasticsearch.Mapping.SemanticTextPropertyDescriptor + /// + /// Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one + /// field for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers. + /// + /// + public Elastic.Clients.Elasticsearch.Mapping.SemanticTextPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.Properties? value) + { + Instance.Fields = value; + return this; + } + + /// + /// + /// Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one + /// field for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers. + /// + /// + public Elastic.Clients.Elasticsearch.Mapping.SemanticTextPropertyDescriptor Fields(System.Action> action) + { + Instance.Fields = Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor.Build(action); + return this; + } + /// /// /// Settings for index_options that override any defaults used by semantic_text, for example @@ -272,6 +304,42 @@ public Elastic.Clients.Elasticsearch.Mapping.SemanticTextPropertyDescriptor Chun return this; } + /// + /// + /// Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one + /// field for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers. + /// + /// + public Elastic.Clients.Elasticsearch.Mapping.SemanticTextPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.Properties? value) + { + Instance.Fields = value; + return this; + } + + /// + /// + /// Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one + /// field for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers. + /// + /// + public Elastic.Clients.Elasticsearch.Mapping.SemanticTextPropertyDescriptor Fields(System.Action action) + { + Instance.Fields = Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor.Build(action); + return this; + } + + /// + /// + /// Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one + /// field for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers. + /// + /// + public Elastic.Clients.Elasticsearch.Mapping.SemanticTextPropertyDescriptor Fields(System.Action> action) + { + Instance.Fields = Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor.Build(action); + return this; + } + /// /// /// Settings for index_options that override any defaults used by semantic_text, for example diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.Converters.g.cs index a5e6d50c9b7..ae8b597bab5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.Converters.g.cs @@ -31,7 +31,7 @@ public sealed partial class TextEmbeddingConverter : System.Text.Json.Serializat public override Elastic.Clients.Elasticsearch.TextEmbedding Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propModelId = default; + LocalJsonValue propModelId = default; LocalJsonValue propModelText = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.g.cs index 1bc9cc5ad77..465897084fe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.g.cs @@ -27,9 +27,8 @@ namespace Elastic.Clients.Elasticsearch; public sealed partial class TextEmbedding { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public TextEmbedding(string modelId, string modelText) + public TextEmbedding(string modelText) { - ModelId = modelId; ModelText = modelText; } #if NET7_0_OR_GREATER @@ -49,11 +48,13 @@ internal TextEmbedding(Elastic.Clients.Elasticsearch.Serialization.JsonConstruct _ = sentinel; } - public -#if NET7_0_OR_GREATER - required -#endif - string ModelId { get; set; } + /// + /// + /// Model ID is required for all dense_vector fields but + /// may be inferred for semantic_text fields + /// + /// + public string? ModelId { get; set; } public #if NET7_0_OR_GREATER required @@ -80,7 +81,13 @@ public TextEmbeddingDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.TextEmbeddingDescriptor(Elastic.Clients.Elasticsearch.TextEmbedding instance) => new Elastic.Clients.Elasticsearch.TextEmbeddingDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.TextEmbedding(Elastic.Clients.Elasticsearch.TextEmbeddingDescriptor descriptor) => descriptor.Instance; - public Elastic.Clients.Elasticsearch.TextEmbeddingDescriptor ModelId(string value) + /// + /// + /// Model ID is required for all dense_vector fields but + /// may be inferred for semantic_text fields + /// + /// + public Elastic.Clients.Elasticsearch.TextEmbeddingDescriptor ModelId(string? value) { Instance.ModelId = value; return this;