From 0eaca0317f6c712082b729423881afc4ec713356 Mon Sep 17 00:00:00 2001 From: Steve Gordon Date: Tue, 11 Oct 2022 18:55:36 +0100 Subject: [PATCH] Update for 8.5 spec, add FieldValue and various fixes (#6732) * Generate on 8.5 spec which includes spec fixes * Update for 8.5 spec, add FieldValue and various fixes --- .../HandleNestTypesOnSourceJsonConverter.cs | 2 +- .../Common/Fields/FieldValue.cs | 392 +++++++++++++++++ .../Common/Fields/FieldValues.cs | 8 +- .../Common/{LazyDocument.cs => LazyJson.cs} | 22 +- .../AggregateDictionaryExtensions.cs | 85 ++++ .../DefaultRequestResponseSerializer.cs | 2 +- .../Serialization/DefaultSourceSerializer.cs | 2 +- .../Serialization/SourceSerialisation.cs | 29 ++ .../TermsAggregateSerializationHelper.cs | 34 +- .../Types/Aggregations/AggregateDictionary.cs | 94 +---- .../AggregateDictionaryConverter.cs | 3 +- .../Types/Aggregations/EmptyTermsAggregate.cs | 30 +- .../Types/Aggregations/TermsAggregate.cs | 2 +- .../QueryDsl/QueryContainerDescriptor.cs | 4 +- .../Types/Sql/SqlValue.cs | 6 +- .../AsyncSearch/AsyncSearchSubmitRequest.g.cs | 30 +- .../Api/DeleteByQueryRethrottleRequest.g.cs | 6 +- .../_Generated/Api/FieldCapsRequest.g.cs | 8 +- .../IndexManagement/ForcemergeResponse.g.cs | 4 + .../_Generated/Api/SearchRequest.g.cs | 30 +- .../Client/ElasticsearchClient.g.cs | 8 +- .../Types/AggregationProfileDebug.g.cs | 4 + ...AggregationProfileDelegateDebugFilter.g.cs | 4 + .../Aggregations/AdjacencyMatrixBucket.g.cs | 13 +- .../Aggregations/AverageAggregation.g.cs | 48 +++ .../Aggregations/BoxplotAggregation.g.cs | 48 +++ .../Aggregations/CardinalityAggregation.g.cs | 48 +++ .../Aggregations/CompositeAggregate.g.cs | 2 +- .../Aggregations/CompositeAggregation.g.cs | 16 +- .../Types/Aggregations/CompositeBucket.g.cs | 6 +- .../Aggregations/DateRangeAggregation.g.cs | 48 +++ .../Aggregations/DoubleTermsAggregate.g.cs | 2 +- .../Aggregations/ExtendedStatsAggregate.g.cs | 8 + .../ExtendedStatsAggregation.g.cs | 48 +++ .../ExtendedStatsBucketAggregate.g.cs | 8 + .../Aggregations/InferenceAggregate.g.cs | 2 +- .../Aggregations/InferenceTopClassEntry.g.cs | 2 +- .../Types/Aggregations/IpRangeBucket.g.cs | 13 +- .../Aggregations/LongTermsAggregate.g.cs | 2 +- .../Aggregations/MatrixStatsAggregation.g.cs | 18 - .../Types/Aggregations/MaxAggregation.g.cs | 48 +++ .../MedianAbsoluteDeviationAggregation.g.cs | 48 +++ .../Types/Aggregations/MinAggregation.g.cs | 48 +++ .../Aggregations/MissingAggregation.g.cs | 48 +++ .../Aggregations/MultiTermsAggregate.g.cs | 2 +- .../Types/Aggregations/MultiTermsBucket.g.cs | 6 +- .../Types/Aggregations/RateAggregation.g.cs | 48 +++ .../ScriptedMetricAggregation.g.cs | 48 +++ .../Types/Aggregations/StatsAggregation.g.cs | 48 +++ .../Aggregations/StringStatsAggregation.g.cs | 48 +++ .../Aggregations/StringTermsAggregate.g.cs | 2 +- .../Types/Aggregations/StringTermsBucket.g.cs | 6 +- .../Types/Aggregations/SumAggregation.g.cs | 48 +++ .../Types/Aggregations/TermsAggregation.g.cs | 48 +++ .../Aggregations/TopHitsAggregation.g.cs | 84 ++-- .../Types/Aggregations/TopMetrics.g.cs | 4 +- .../Aggregations/TopMetricsAggregation.g.cs | 48 +++ .../Aggregations/ValueCountAggregation.g.cs | 48 +++ .../Analysis/IcuTransformTokenFilter.g.cs | 14 +- .../Types/BulkResponseItemBase.g.cs | 2 +- .../Types/Enums/Enums.Aggregations.g.cs | 7 + .../_Generated/Types/Enums/Enums.Mapping.g.cs | 49 +++ .../Types/Enums/Enums.NoNamespace.g.cs | 7 + .../Types/FetchProfileBreakdown.g.cs | 8 + .../_Generated/Types/FieldSort.g.cs | 4 + .../_Generated/Types/HighlightField.g.cs | 50 ++- .../_Generated/Types/Hit.g.cs | 2 +- .../IndexManagement/IndexSegmentSort.g.cs | 18 - .../IndexManagement/IndexVersioning.g.cs | 18 + .../IndexManagement/RolloverConditions.g.cs | 72 ++++ .../SettingsSimilarityBm25.g.cs | 6 +- .../_Generated/Types/InnerHits.g.cs | 36 -- .../AggregateMetricDoubleProperty.g.cs | 36 +- .../Types/Mapping/BinaryProperty.g.cs | 18 - .../Types/Mapping/BooleanProperty.g.cs | 18 - .../Types/Mapping/ByteNumberProperty.g.cs | 82 +++- .../Types/Mapping/CompletionProperty.g.cs | 18 - .../Types/Mapping/DateNanosProperty.g.cs | 18 - .../Types/Mapping/DateProperty.g.cs | 18 - .../Types/Mapping/DateRangeProperty.g.cs | 18 - .../Types/Mapping/DoubleNumberProperty.g.cs | 82 +++- .../Types/Mapping/DoubleRangeProperty.g.cs | 18 - .../Types/Mapping/DynamicProperty.g.cs | 28 +- .../Types/Mapping/FloatNumberProperty.g.cs | 82 +++- .../Types/Mapping/FloatRangeProperty.g.cs | 18 - .../Types/Mapping/GeoPointProperty.g.cs | 18 - .../Types/Mapping/GeoShapeProperty.g.cs | 18 - .../Mapping/HalfFloatNumberProperty.g.cs | 82 +++- .../Types/Mapping/IntegerNumberProperty.g.cs | 82 +++- .../Types/Mapping/IntegerRangeProperty.g.cs | 18 - .../_Generated/Types/Mapping/IpProperty.g.cs | 118 +++++- .../Types/Mapping/IpRangeProperty.g.cs | 18 - .../Types/Mapping/JoinProperty.g.cs | 36 +- .../Types/Mapping/KeywordProperty.g.cs | 18 - .../Types/Mapping/LongNumberProperty.g.cs | 82 +++- .../Types/Mapping/LongRangeProperty.g.cs | 18 - .../Types/Mapping/MatchOnlyTextProperty.g.cs | 18 - .../Types/Mapping/Murmur3HashProperty.g.cs | 18 - .../Types/Mapping/NestedProperty.g.cs | 18 - .../Types/Mapping/ObjectProperty.g.cs | 18 - .../Types/Mapping/PointProperty.g.cs | 18 - .../Mapping/ScaledFloatNumberProperty.g.cs | 146 ++++++- .../Mapping/SearchAsYouTypeProperty.g.cs | 18 - .../Types/Mapping/ShapeProperty.g.cs | 18 - .../Types/Mapping/ShortNumberProperty.g.cs | 82 +++- .../_Generated/Types/Mapping/SourceField.g.cs | 18 + .../Types/Mapping/TextProperty.g.cs | 18 - .../Types/Mapping/TokenCountProperty.g.cs | 18 - .../Mapping/UnsignedLongNumberProperty.g.cs | 162 ++++++- .../Types/Mapping/VersionProperty.g.cs | 18 - .../Types/Mapping/WildcardProperty.g.cs | 18 - .../_Generated/Types/MultisearchBody.g.cs | 30 +- .../_Generated/Types/NodeAttributes.g.cs | 4 + .../_Generated/Types/Operation.g.cs | 12 - .../Types/QueryDsl/MultiMatchQuery.g.cs | 18 - .../_Generated/Types/QueryDsl/TermQuery.g.cs | 12 +- .../Types/QueryDsl/TermsQueryField.g.cs | 4 +- .../_Generated/Types/SlicedScroll.g.cs | 14 +- .../_Generated/Types/Source.g.cs | 18 - .../_Generated/Types/SourceFilter.g.cs | 24 -- .../Types/Tasks/ParentTaskInfo.g.cs | 4 + .../_Generated/Types/Tasks/TaskInfo.g.cs | 4 + src/PlaygroundV7x/PlaygroundV7x.csproj | 2 +- src/PlaygroundV7x/Program.cs | 399 ++++++++++-------- src/PlaygroundV7x/packages.lock.json | 12 +- tests/Tests.Configuration/tests.default.yaml | 2 +- .../Bucket/TermsAggregationUsageTests.cs | 8 +- .../Metric/AverageAggregationUsageTests.cs | 8 +- .../Metric/BoxplotAggregationUsageTests.cs | 6 +- .../Tests/AsyncSearch/AsyncSearchApiTests.cs | 8 +- tests/Tests/Common/Fields/FieldValueTests.cs | 95 +++++ .../DeleteByQuery/DeleteByQueryApiTests.cs | 3 +- .../DeleteByQueryRethrottleApiTests.cs | 2 +- .../DeleteByQueryRethrottleUrlTests.cs | 2 +- tests/Tests/Search/Search/SearchApiTests.cs | 2 +- .../ChildrenAggregateSerializationTests.cs | 15 +- .../TermsAggregateDeserializationTests.cs | 49 +-- .../Queries/SearchSerializationTests.cs | 4 +- .../SearchResponseDeserialisationTests.cs | 18 +- ...nSerialize_BoolFieldValueKind.verified.txt | 3 + ...erialize_DoubleFieldValueKind.verified.txt | 3 + ...nSerialize_LongFieldValueKind.verified.txt | 3 + ...nSerialize_NullFieldValueKind.verified.txt | 3 + ...erialize_StringFieldValueKind.verified.txt | 3 + ...ageTests.VerifyDescriptorJson.verified.txt | 1 + ...geTests.VerifyInitializerJson.verified.txt | 1 + 146 files changed, 3118 insertions(+), 1360 deletions(-) create mode 100644 src/Elastic.Clients.Elasticsearch/Common/Fields/FieldValue.cs rename src/Elastic.Clients.Elasticsearch/Common/{LazyDocument.cs => LazyJson.cs} (56%) create mode 100644 src/Elastic.Clients.Elasticsearch/Experimental/AggregateDictionaryExtensions.cs create mode 100644 tests/Tests/Common/Fields/FieldValueTests.cs create mode 100644 tests/Tests/_VerifySnapshots/FieldValueTests.CanSerialize_BoolFieldValueKind.verified.txt create mode 100644 tests/Tests/_VerifySnapshots/FieldValueTests.CanSerialize_DoubleFieldValueKind.verified.txt create mode 100644 tests/Tests/_VerifySnapshots/FieldValueTests.CanSerialize_LongFieldValueKind.verified.txt create mode 100644 tests/Tests/_VerifySnapshots/FieldValueTests.CanSerialize_NullFieldValueKind.verified.txt create mode 100644 tests/Tests/_VerifySnapshots/FieldValueTests.CanSerialize_StringFieldValueKind.verified.txt diff --git a/src/Elastic.Clients.Elasticsearch.JsonNetSerializer/Converters/HandleNestTypesOnSourceJsonConverter.cs b/src/Elastic.Clients.Elasticsearch.JsonNetSerializer/Converters/HandleNestTypesOnSourceJsonConverter.cs index 1c7e6a43297..09be35a7063 100644 --- a/src/Elastic.Clients.Elasticsearch.JsonNetSerializer/Converters/HandleNestTypesOnSourceJsonConverter.cs +++ b/src/Elastic.Clients.Elasticsearch.JsonNetSerializer/Converters/HandleNestTypesOnSourceJsonConverter.cs @@ -21,7 +21,7 @@ public class HandleNestTypesOnSourceJsonConverter : JsonConverter typeof(QueryContainer), //typeof(CompletionField), //typeof(Attachment), - typeof(LazyDocument), + typeof(LazyJson), //typeof(GeoCoordinate), typeof(GeoLocation), //typeof(CartesianPoint), diff --git a/src/Elastic.Clients.Elasticsearch/Common/Fields/FieldValue.cs b/src/Elastic.Clients.Elasticsearch/Common/Fields/FieldValue.cs new file mode 100644 index 00000000000..692836ec624 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/Common/Fields/FieldValue.cs @@ -0,0 +1,392 @@ +// 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. + +using System.Text.Json.Serialization; +using System.Text.Json; +using System; +using System.Diagnostics.CodeAnalysis; +using System.Collections.Generic; + +namespace Elastic.Clients.Elasticsearch +{ + /// + /// Represents a value for a field which depends on the field mapping and is only known at runtime, + /// therefore cannot be specifically typed. + /// + [JsonConverter(typeof(FieldValueConverter))] + public readonly struct FieldValue : IEquatable + { + internal FieldValue(ValueKind kind, object? value) { Kind = kind; Value = value; } + + /// + /// The kind of value contained within this . + /// + public readonly ValueKind Kind { get; } + + /// + /// The value contained within within this . + /// + public readonly object? Value { get; } + + /// + /// An enumeration of the possible value kinds that the may contain. + /// + public enum ValueKind + { + Null, + Double, + Long, + Boolean, + String, + LazyDocument, + Composite + } + + /// + /// Represents a null value. + /// + public static FieldValue Null { get; } = new(ValueKind.Null, null); + + /// + /// Represents a true boolean value. + /// + public static FieldValue True { get; } = new(ValueKind.Boolean, true); + + /// + /// Represents a false boolean value. + /// + public static FieldValue False { get; } = new(ValueKind.Boolean, false); + + /// + /// Factory method to create a containing a long value. + /// + /// The long to store as the value. + /// The new . + public static FieldValue Long(long value) => new(ValueKind.Long, value); + + /// + /// Factory method to create a containing a boolean value. + /// + /// The boolean to store as the value. + /// The new . + public static FieldValue Boolean(bool value) => new(ValueKind.Boolean, value); + + /// + /// Factory method to create a containing a double value. + /// + /// The double to store as the value. + /// The new . + public static FieldValue Double(double value) => new(ValueKind.Double, value); + + /// + /// Factory method to create a containing a string value. + /// + /// The string to store as the value. + /// The new . + public static FieldValue String(string value) => new(ValueKind.String, value); + + // These are not expected to be required for consumer values but are used internally. + internal static FieldValue Any(LazyJson value) => new(ValueKind.LazyDocument, value); + internal static FieldValue Composite(object value) => new(ValueKind.Composite, value); + + /// + /// Checks if the value of . + /// + public bool IsString => Kind == ValueKind.String; + + /// + /// Checks if the value of . + /// + public bool IsBool => Kind == ValueKind.Boolean; + + /// + /// Checks if the value of . + /// + public bool IsLong => Kind == ValueKind.Long; + + /// + /// Checks if the value of . + /// + public bool IsDouble => Kind == ValueKind.Double; + + /// + /// Checks if the value of . + /// + public bool IsLazyDocument => Kind == ValueKind.LazyDocument; + + /// + /// Checks if the value of . + /// + public bool IsNull => Kind == ValueKind.Null; + + /// + /// Checks if the value of . + /// + public bool IsComposite => Kind == ValueKind.Composite; + + /// + /// Gets the value when the value kind is . + /// + /// When this method returns, contains the value associated with this , + /// if the value kind is ; otherwise, the default value for the type of the value parameter. + /// This parameter is passed uninitialized. + /// True if the value is a . + public bool TryGetString([NotNullWhen(returnValue: true)] out string? value) + { + value = null; + + if (!IsString) + return false; + + value = (string)Value; + return true; + } + + /// + /// Gets the value when the value kind is . + /// + /// When this method returns, contains the value associated with this , + /// if the value kind is ; otherwise, the default value for the type of the value parameter. + /// This parameter is passed uninitialized. + /// True if the value is a . + public bool TryGetBool([NotNullWhen(returnValue: true)] out bool? value) + { + value = null; + + if (!IsBool) + return false; + + value = (bool)Value; + return true; + } + + /// + /// Gets the value when the value kind is . + /// + /// When this method returns, contains the value associated with this , + /// if the value kind is ; otherwise, the default value for the type of the value parameter. + /// This parameter is passed uninitialized. + /// True if the value is a . + public bool TryGetLong([NotNullWhen(returnValue: true)] out long? value) + { + value = null; + + if (!IsLong) + return false; + + value = (long)Value; + return true; + } + + /// + /// Gets the value when the value kind is . + /// + /// When this method returns, contains the value associated with this , + /// if the value kind is ; otherwise, the default value for the type of the value parameter. + /// This parameter is passed uninitialized. + /// True if the value is a . + public bool TryGetDouble([NotNullWhen(returnValue: true)] out double? value) + { + value = null; + + if (!IsDouble) + return false; + + value = (double)Value; + return true; + } + + /// + /// Gets the value when the value kind is . + /// + /// When this method returns, contains the value associated with this , + /// if the value kind is ; otherwise, the default value for the type of the value parameter. + /// This parameter is passed uninitialized. + /// True if the value is a . + public bool TryGetLazyDocument([NotNullWhen(returnValue: true)] out LazyJson? value) + { + value = null; + + if (!IsLazyDocument) + return false; + + value = (LazyJson)Value; + return true; + } + + /// + /// Gets the value when the value kind is and the value type is . + /// + /// The type expected for the value. + /// When this method returns, contains the value associated with this , + /// if the value kind is and the value type is ; otherwise, the default + /// value for the type of the value parameter. This parameter is passed uninitialized. + /// True if the value is of the specified type. + public bool TryGet([NotNullWhen(returnValue: true)] out T? value) + { + value = default; + + if (!IsComposite || Value is not T typedValue) + return false; + + value = typedValue; + return true; + } + + internal bool TryGetComposite([NotNullWhen(returnValue: true)] out object? value) + { + value = default; + + if (!IsComposite) + return false; + + value = Value; + return true; + } + + public override string ToString() + { + if (Kind == ValueKind.String) + { + return Value as string; + } + else if (Kind == ValueKind.Double) + { + return ((double)Value).ToString(); + } + else if (Kind == ValueKind.Long) + { + return ((long)Value).ToString(); + } + else if (Kind == ValueKind.Boolean) + { + return ((bool)Value).ToString(); + } + else if (Kind == ValueKind.Null) + { + return "null"; + } + else if (Kind == ValueKind.LazyDocument || Kind == ValueKind.Composite) + { + throw new InvalidOperationException("Composite field value cannot be formatted as a string."); + } + else + { + throw new InvalidOperationException($"Unknown kind '{Kind}'"); + } + } + + public override bool Equals(object? obj) => obj is FieldValue value && Equals(value); + public bool Equals(FieldValue other) => Kind == other.Kind && EqualityComparer.Default.Equals(Value, other.Value); + + public override int GetHashCode() + { + unchecked + { + var hashCode = 1484969029; + hashCode = hashCode * -1521134295 + Kind.GetHashCode(); + hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Value); + return hashCode; + } + } + + public static bool operator ==(FieldValue left, FieldValue right) => left.Equals(right); + public static bool operator !=(FieldValue left, FieldValue right) => !(left == right); + + public static implicit operator FieldValue(string value) => String(value); + public static implicit operator FieldValue(bool value) => Boolean(value); + public static implicit operator FieldValue(int value) => Long(value); + public static implicit operator FieldValue(long value) => Long(value); + public static implicit operator FieldValue(double value) => Double(value); + } + + internal sealed class FieldValueConverter : JsonConverter + { + public override FieldValue Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case JsonTokenType.Null: + return FieldValue.Null; + + case JsonTokenType.String: + var stringValue = reader.GetString(); + return FieldValue.String(stringValue); + + case JsonTokenType.Number: + if (reader.TryGetInt64(out var l)) + { + return FieldValue.Long(l); + } + else if (reader.TryGetDouble(out var d)) + { + return FieldValue.Double(d); + } + else + { + throw new JsonException("Unexpected number format which cannot be deserialised as a FieldValue."); + } + + case JsonTokenType.True: + return FieldValue.True; + + case JsonTokenType.False: + return FieldValue.False; + + case JsonTokenType.StartObject: + case JsonTokenType.StartArray: + var value = JsonSerializer.Deserialize(ref reader, options); + return FieldValue.Any(value); + } + + throw new JsonException($"Unexpected token type '{reader.TokenType}' read while deserializing a FieldValue."); + } + + public override void Write(Utf8JsonWriter writer, FieldValue value, JsonSerializerOptions options) + { + if (value.TryGetString(out var stringValue)) + { + writer.WriteStringValue(stringValue); + } + + else if (value.TryGetBool(out var boolValue)) + { + writer.WriteBooleanValue(boolValue.Value); + } + + else if (value.TryGetLong(out var longValue)) + { + writer.WriteNumberValue(longValue.Value); + } + + else if (value.TryGetDouble(out var doubleValue)) + { + writer.WriteNumberValue(doubleValue.Value); + } + + else if (value.TryGetLazyDocument(out var lazyDocument)) + { + writer.WriteRawValue(lazyDocument.Value.Bytes); + } + + else if (value.TryGetComposite(out var objectValue)) + { + if (!options.TryGetClientSettings(out var settings)) + throw new JsonException("Unable to retrieve ElasticsearchClientSettings in order to access source serializer."); + + SourceSerialisation.Serialize(objectValue, objectValue.GetType(), writer, settings); + } + + else if (value.Kind == FieldValue.ValueKind.Null) + { + writer.WriteNullValue(); + } + + else + { + throw new JsonException($"Unsupported FieldValue kind. This is likely a bug and should be reported as an issue."); + } + } + } +} diff --git a/src/Elastic.Clients.Elasticsearch/Common/Fields/FieldValues.cs b/src/Elastic.Clients.Elasticsearch/Common/Fields/FieldValues.cs index 5a980b645fb..72f7151df8e 100644 --- a/src/Elastic.Clients.Elasticsearch/Common/Fields/FieldValues.cs +++ b/src/Elastic.Clients.Elasticsearch/Common/Fields/FieldValues.cs @@ -12,7 +12,7 @@ namespace Elastic.Clients.Elasticsearch { [JsonConverter(typeof(FieldValuesConverter))] - public sealed class FieldValues : IsADictionaryBase + public sealed class FieldValues : IsADictionaryBase { public static readonly FieldValues Empty = new(); @@ -28,7 +28,7 @@ public sealed class FieldValues : IsADictionaryBase private FieldValues() { } - internal FieldValues(Inferrer inferrer, IDictionary container) + internal FieldValues(Inferrer inferrer, IDictionary container) : base(container) => _inferrer = inferrer; public TValue Value(Field field) @@ -109,7 +109,7 @@ internal sealed class FieldValuesConverter : JsonConverter return null; } - var fields = new Dictionary(); + var fields = new Dictionary(); while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { @@ -118,7 +118,7 @@ internal sealed class FieldValuesConverter : JsonConverter var propertyName = reader.GetString(); reader.Read(); - var lazyDocument = JsonSerializer.Deserialize(ref reader, options); + var lazyDocument = JsonSerializer.Deserialize(ref reader, options); fields[propertyName] = lazyDocument; } diff --git a/src/Elastic.Clients.Elasticsearch/Common/LazyDocument.cs b/src/Elastic.Clients.Elasticsearch/Common/LazyJson.cs similarity index 56% rename from src/Elastic.Clients.Elasticsearch/Common/LazyDocument.cs rename to src/Elastic.Clients.Elasticsearch/Common/LazyJson.cs index d847629a6e1..597e56bbccb 100644 --- a/src/Elastic.Clients.Elasticsearch/Common/LazyDocument.cs +++ b/src/Elastic.Clients.Elasticsearch/Common/LazyJson.cs @@ -9,13 +9,13 @@ namespace Elastic.Clients.Elasticsearch { /// - /// A lazily deserialized document. - /// Holds raw JSON bytes which can be lazily converted to a specific at a later time. + /// Lazily deserializable JSON. + /// Holds raw JSON bytes which can be lazily deserialized to a specific using the source serializer at a later time. /// - [JsonConverter(typeof(LazyDocumentConverter))] - public readonly struct LazyDocument + [JsonConverter(typeof(LazyJsonConverter))] + public readonly struct LazyJson { - internal LazyDocument(byte[] bytes, IElasticsearchClientSettings settings) + internal LazyJson(byte[] bytes, IElasticsearchClientSettings settings) { Bytes = bytes; Settings = settings; @@ -26,7 +26,7 @@ internal LazyDocument(byte[] bytes, IElasticsearchClientSettings settings) /// /// Creates an instance of from this - /// instance. + /// instance. /// /// The type public T? As() @@ -39,13 +39,13 @@ internal LazyDocument(byte[] bytes, IElasticsearchClientSettings settings) } } - internal sealed class LazyDocumentConverter : JsonConverter + internal sealed class LazyJsonConverter : JsonConverter { private readonly IElasticsearchClientSettings _settings; - public LazyDocumentConverter(IElasticsearchClientSettings settings) => _settings = settings; + public LazyJsonConverter(IElasticsearchClientSettings settings) => _settings = settings; - public override LazyDocument Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + public override LazyJson Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { using var jsonDoc = JsonSerializer.Deserialize(ref reader); using var stream = _settings.MemoryStreamFactory.Create(); @@ -54,9 +54,9 @@ public override LazyDocument Read(ref Utf8JsonReader reader, Type typeToConvert, jsonDoc.WriteTo(writer); writer.Flush(); - return new LazyDocument(stream.ToArray(), _settings); + return new LazyJson(stream.ToArray(), _settings); } - public override void Write(Utf8JsonWriter writer, LazyDocument value, JsonSerializerOptions options) => throw new NotImplementedException("We only ever expect to deserialize a LazyDocument on responses."); + public override void Write(Utf8JsonWriter writer, LazyJson value, JsonSerializerOptions options) => throw new NotImplementedException("We only ever expect to deserialize LazyJson on responses."); } } diff --git a/src/Elastic.Clients.Elasticsearch/Experimental/AggregateDictionaryExtensions.cs b/src/Elastic.Clients.Elasticsearch/Experimental/AggregateDictionaryExtensions.cs new file mode 100644 index 00000000000..4f302e9d53f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/Experimental/AggregateDictionaryExtensions.cs @@ -0,0 +1,85 @@ +// 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. + +using Elastic.Clients.Elasticsearch.Aggregations; +using System; +using System.Linq; + +namespace Elastic.Clients.Elasticsearch.Experimental +{ + internal static class AggregateDictionaryExtensions + { + /// + /// WARNING: EXPERIMENTAL API + /// This API provides simplified access to terms aggregations. + /// + /// Experimental APIs are subject to changes or removal and should be used with caution. + public static TermsAggregate GetTerms(this AggregateDictionary aggregationDictionary, string key) => aggregationDictionary.GetTerms(key); + + /// + /// WARNING: EXPERIMENTAL API + /// This API provides simplified access to terms aggregations. + /// + /// Experimental APIs are subject to changes or removal and should be used with caution. + public static TermsAggregate GetTerms(this AggregateDictionary aggregationDictionary, string key) + { + if (!aggregationDictionary.TryGetValue(key, out var agg)) + { + return null; + } + + switch (agg) + { + case StringTermsAggregate stringTerms: + var buckets = stringTerms.Buckets.Select(b => new TermsBucket(b.BackingDictionary) { DocCount = b.DocCount, DocCountError = b.DocCountError, Key = GetKeyFromBucketKey(b.Key), KeyAsString = b.Key.ToString() }).ToReadOnlyCollection(); // ToString is a temp hack here + return new TermsAggregate + { + Buckets = buckets, + Meta = stringTerms.Meta, + DocCountErrorUpperBound = stringTerms.DocCountErrorUpperBound, + SumOtherDocCount = stringTerms.SumOtherDocCount + }; + + case DoubleTermsAggregate doubleTerms: + var doubleTermsBuckets = doubleTerms.Buckets.Select(b => new TermsBucket(b.BackingDictionary) { DocCount = b.DocCount, DocCountError = b.DocCountError, Key = GetKeyFromBucketKey(b.Key), KeyAsString = b.KeyAsString }).ToReadOnlyCollection(); + return new TermsAggregate + { + Buckets = doubleTermsBuckets, + Meta = doubleTerms.Meta, + DocCountErrorUpperBound = doubleTerms.DocCountErrorUpperBound, + SumOtherDocCount = doubleTerms.SumOtherDocCount + }; + + case LongTermsAggregate longTerms: + var longTermsBuckets = longTerms.Buckets.Select(b => new TermsBucket(b.BackingDictionary) { DocCount = b.DocCount, DocCountError = b.DocCountError, Key = GetKeyFromBucketKey(b.Key), KeyAsString = b.KeyAsString }).ToReadOnlyCollection(); + return new TermsAggregate + { + Buckets = longTermsBuckets, + Meta = longTerms.Meta, + DocCountErrorUpperBound = longTerms.DocCountErrorUpperBound, + SumOtherDocCount = longTerms.SumOtherDocCount + }; + + // TODO - Multi-terms + } + + return null; + } + + private static TKey GetKeyFromBucketKey(object key) + { + if (typeof(TKey).IsEnum) + { + return (TKey)Enum.Parse(typeof(TKey), key.ToString(), true); + } + + if (key is FieldValue fieldValue) + { + return (TKey)Convert.ChangeType(fieldValue.Value, typeof(TKey)); + } + + return (TKey)Convert.ChangeType(key, typeof(TKey)); + } + } +} diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/DefaultRequestResponseSerializer.cs b/src/Elastic.Clients.Elasticsearch/Serialization/DefaultRequestResponseSerializer.cs index e56183774f2..5e70955a26d 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/DefaultRequestResponseSerializer.cs +++ b/src/Elastic.Clients.Elasticsearch/Serialization/DefaultRequestResponseSerializer.cs @@ -37,7 +37,7 @@ public DefaultRequestResponseSerializer(IElasticsearchClientSettings settings) new IdConverter(settings), new FieldConverter(settings), new FieldValuesConverter(settings), - new LazyDocumentConverter(settings), + new LazyJsonConverter(settings), new RelationNameConverter(settings), new JoinFieldConverter(settings), new CustomJsonWriterConverterFactory(settings), diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/DefaultSourceSerializer.cs b/src/Elastic.Clients.Elasticsearch/Serialization/DefaultSourceSerializer.cs index a51a502629d..3b59a3975a5 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/DefaultSourceSerializer.cs +++ b/src/Elastic.Clients.Elasticsearch/Serialization/DefaultSourceSerializer.cs @@ -21,7 +21,7 @@ public DefaultSourceSerializer(IElasticsearchClientSettings settings, JsonSerial new RelationNameConverter(settings), new RoutingConverter(settings), new JoinFieldConverter(settings), - new LazyDocumentConverter(settings), + new LazyJsonConverter(settings), new IdsConverter(settings) }, PropertyNamingPolicy = JsonNamingPolicy.CamelCase diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/SourceSerialisation.cs b/src/Elastic.Clients.Elasticsearch/Serialization/SourceSerialisation.cs index a9470428235..6af0684d17c 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/SourceSerialisation.cs +++ b/src/Elastic.Clients.Elasticsearch/Serialization/SourceSerialisation.cs @@ -57,6 +57,9 @@ public static T DeserializeParams(ref Utf8JsonReader reader, IElasticsearchCl public static void Serialize(T toSerialize, Utf8JsonWriter writer, IElasticsearchClientSettings settings) => Serialize(toSerialize, writer, settings.SourceSerializer); + public static void Serialize(object toSerialize, Type type, Utf8JsonWriter writer, IElasticsearchClientSettings settings) => + Serialize(toSerialize, type, writer, settings.SourceSerializer); + public static void Serialize(T toSerialize, Utf8JsonWriter writer, Serializer sourceSerializer) { if (sourceSerializer is DefaultSourceSerializer defaultSerializer) @@ -83,6 +86,32 @@ public static void Serialize(T toSerialize, Utf8JsonWriter writer, Serializer #endif } + public static void Serialize(object toSerialize, Type type, Utf8JsonWriter writer, Serializer sourceSerializer) + { + if (sourceSerializer is DefaultSourceSerializer defaultSerializer) + { + // When the serializer is our own, which uses STJ we can avoid unneccesary allocations and serialise straight into the writer + // In most cases this is not the case as it's wrapped in the DiagnosticsSerializerProxy + // Ideally, we'd short-circuit here if we know there are no listeners or avoid wrapping the default source serializer. + JsonSerializer.Serialize(writer, toSerialize, type, defaultSerializer.Options); + return; + } + + // We may be using a custom serializer or most likely, we're registered via DiagnosticsSerializerProxy + // We cannot use STJ since the implementation may use another serializer. + // This path is a little less optimal + using var ms = new MemoryStream(); + sourceSerializer.Serialize(toSerialize, ms); + ms.Position = 0; +#if NET6_0_OR_GREATER + writer.WriteRawValue(ms.GetBuffer().AsSpan()[..(int)ms.Length], true); +#else + // This is not super efficient but a variant on the suggestion at https://github.com/dotnet/runtime/issues/1784#issuecomment-608331125 + using var document = JsonDocument.Parse(ms); + document.RootElement.WriteTo(writer); +#endif + } + public static T Deserialize(ref Utf8JsonReader reader, IElasticsearchClientSettings settings) { var sourceSerializer = settings.SourceSerializer; diff --git a/src/Elastic.Clients.Elasticsearch/Serialization/TermsAggregateSerializationHelper.cs b/src/Elastic.Clients.Elasticsearch/Serialization/TermsAggregateSerializationHelper.cs index 06abf039ab1..d1ba447f9ac 100644 --- a/src/Elastic.Clients.Elasticsearch/Serialization/TermsAggregateSerializationHelper.cs +++ b/src/Elastic.Clients.Elasticsearch/Serialization/TermsAggregateSerializationHelper.cs @@ -15,7 +15,7 @@ internal static class TermsAggregateSerializationHelper private static readonly byte[] s_key = Encoding.UTF8.GetBytes("key"); private static readonly byte s_period = (byte)'.'; - public static bool TryDeserialiseTermsAggregate(ref Utf8JsonReader reader, JsonSerializerOptions options, out IAggregate? aggregate) + public static bool TryDeserialiseTermsAggregate(string aggregateName, ref Utf8JsonReader reader, JsonSerializerOptions options, out IAggregate? aggregate) { aggregate = null; @@ -31,9 +31,35 @@ public static bool TryDeserialiseTermsAggregate(ref Utf8JsonReader reader, JsonS if (readerCopy.TokenType == JsonTokenType.EndArray) // We have no buckets { - var agg = JsonSerializer.Deserialize(ref reader, options); - aggregate = agg; - return true; + if (aggregateName.Equals("sterms", StringComparison.Ordinal)) + { + var agg = JsonSerializer.Deserialize(ref reader, options); + aggregate = agg; + return true; + } + + if (aggregateName.Equals("lterms", StringComparison.Ordinal)) + { + var agg = JsonSerializer.Deserialize(ref reader, options); + aggregate = agg; + return true; + } + + if (aggregateName.Equals("dterms", StringComparison.Ordinal)) + { + var agg = JsonSerializer.Deserialize(ref reader, options); + aggregate = agg; + return true; + } + + if (aggregateName.Equals("multi_terms", StringComparison.Ordinal)) + { + var agg = JsonSerializer.Deserialize(ref reader, options); + aggregate = agg; + return true; + } + + throw new JsonException($"Unable to deserialize empty terms aggregate for '{aggregateName}'."); } else { diff --git a/src/Elastic.Clients.Elasticsearch/Types/Aggregations/AggregateDictionary.cs b/src/Elastic.Clients.Elasticsearch/Types/Aggregations/AggregateDictionary.cs index 03bb99058bd..eeddd8cf2ff 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Aggregations/AggregateDictionary.cs +++ b/src/Elastic.Clients.Elasticsearch/Types/Aggregations/AggregateDictionary.cs @@ -2,103 +2,11 @@ // 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. -using System; -using System.Collections.Generic; -using System.Linq; - namespace Elastic.Clients.Elasticsearch.Aggregations { public partial class AggregateDictionary { - public EmptyTermsAggregate? EmptyTerms(string key) => TryGet(key); - - public bool IsEmptyTerms(string key) => !BackingDictionary.TryGetValue(key, out var agg) || agg is EmptyTermsAggregate; - - // This should be autogenerated if we want to include this. - //public bool TryGetStringTerms(string key, out StringTermsAggregate? aggregate) - //{ - // aggregate = null; - - // if (BackingDictionary.TryGetValue(key, out var agg) && agg is StringTermsAggregate stringTermsAgg) - // { - // aggregate = stringTermsAgg; - // return true; - // } - - // return false; - //} - + /// public AvgAggregate? GetAverage(string key) => TryGet(key); - - /// - /// WARNING: EXPERIMENTAL API - /// This API provides simplified access to terms aggregations. - /// - /// Experimental APIs are subject to changes or removal and should be used with caution. - public TermsAggregate GetTerms(string key) => GetTerms(key); - - /// - /// WARNING: EXPERIMENTAL API - /// This API provides simplified access to terms aggregations. - /// - /// Experimental APIs are subject to changes or removal and should be used with caution. - public TermsAggregate GetTerms(string key) - { - if (!BackingDictionary.TryGetValue(key, out var agg)) - { - return null; - } - - switch (agg) - { - case EmptyTermsAggregate empty: - return new TermsAggregate - { - Buckets = Array.Empty>().ToReadOnlyCollection(), - Meta = empty.Meta, - DocCountErrorUpperBound = empty.DocCountErrorUpperBound, - SumOtherDocCount = empty.SumOtherDocCount - }; - - case StringTermsAggregate stringTerms: - var buckets = stringTerms.Buckets.Select(b => new TermsBucket(b.BackingDictionary) { DocCount = b.DocCount, DocCountError = b.DocCountError, Key = GetKeyFromBucketKey(b.Key), KeyAsString = b.Key }).ToReadOnlyCollection(); - return new TermsAggregate - { - Buckets = buckets, - Meta = stringTerms.Meta, - DocCountErrorUpperBound = stringTerms.DocCountErrorUpperBound, - SumOtherDocCount = stringTerms.SumOtherDocCount - }; - - case DoubleTermsAggregate doubleTerms: - var doubleTermsBuckets = doubleTerms.Buckets.Select(b => new TermsBucket(b.BackingDictionary) { DocCount = b.DocCount, DocCountError = b.DocCountError, Key = GetKeyFromBucketKey(b.Key), KeyAsString = b.KeyAsString }).ToReadOnlyCollection(); - return new TermsAggregate - { - Buckets = doubleTermsBuckets, - Meta = doubleTerms.Meta, - DocCountErrorUpperBound = doubleTerms.DocCountErrorUpperBound, - SumOtherDocCount = doubleTerms.SumOtherDocCount - }; - - case LongTermsAggregate longTerms: - var longTermsBuckets = longTerms.Buckets.Select(b => new TermsBucket(b.BackingDictionary) { DocCount = b.DocCount, DocCountError = b.DocCountError, Key = GetKeyFromBucketKey(b.Key), KeyAsString = b.KeyAsString }).ToReadOnlyCollection(); - return new TermsAggregate - { - Buckets = longTermsBuckets, - Meta = longTerms.Meta, - DocCountErrorUpperBound = longTerms.DocCountErrorUpperBound, - SumOtherDocCount = longTerms.SumOtherDocCount - }; - - // TODO - Multi-terms - } - - return null; - } - - private static TKey GetKeyFromBucketKey(object key) => - typeof(TKey).IsEnum - ? (TKey)Enum.Parse(typeof(TKey), key.ToString(), true) - : (TKey)Convert.ChangeType(key, typeof(TKey)); } } diff --git a/src/Elastic.Clients.Elasticsearch/Types/Aggregations/AggregateDictionaryConverter.cs b/src/Elastic.Clients.Elasticsearch/Types/Aggregations/AggregateDictionaryConverter.cs index cf6ac4355e7..47890fa2bce 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Aggregations/AggregateDictionaryConverter.cs +++ b/src/Elastic.Clients.Elasticsearch/Types/Aggregations/AggregateDictionaryConverter.cs @@ -49,8 +49,9 @@ public static void ReadAggregate(ref Utf8JsonReader reader, JsonSerializerOption case "terms": case "sterms": case "lterms": + case "dterms": { - if (TermsAggregateSerializationHelper.TryDeserialiseTermsAggregate(ref reader, options, out var agg)) + if (TermsAggregateSerializationHelper.TryDeserialiseTermsAggregate(aggregateName, ref reader, options, out var agg)) { dictionary.Add(nameParts[1], agg); } diff --git a/src/Elastic.Clients.Elasticsearch/Types/Aggregations/EmptyTermsAggregate.cs b/src/Elastic.Clients.Elasticsearch/Types/Aggregations/EmptyTermsAggregate.cs index 42cf200b0a4..4380d1febf2 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Aggregations/EmptyTermsAggregate.cs +++ b/src/Elastic.Clients.Elasticsearch/Types/Aggregations/EmptyTermsAggregate.cs @@ -7,22 +7,22 @@ namespace Elastic.Clients.Elasticsearch.Aggregations { - public sealed class EmptyTermsAggregate : IAggregate - { - [JsonInclude] - [JsonPropertyName("doc_count_error_upper_bound")] - public long? DocCountErrorUpperBound { get; init; } + //public sealed class EmptyTermsAggregate : IAggregate + //{ + // [JsonInclude] + // [JsonPropertyName("doc_count_error_upper_bound")] + // public long? DocCountErrorUpperBound { get; init; } - [JsonInclude] - [JsonPropertyName("sum_other_doc_count")] - public long SumOtherDocCount { get; init; } + // [JsonInclude] + // [JsonPropertyName("sum_other_doc_count")] + // public long SumOtherDocCount { get; init; } - [JsonInclude] - [JsonPropertyName("buckets")] - public Buckets> Buckets { get; init; } + // [JsonInclude] + // [JsonPropertyName("buckets")] + // public Buckets> Buckets { get; init; } - [JsonInclude] - [JsonPropertyName("meta")] - public Dictionary? Meta { get; init; } - } + // [JsonInclude] + // [JsonPropertyName("meta")] + // public Dictionary? Meta { get; init; } + //} } diff --git a/src/Elastic.Clients.Elasticsearch/Types/Aggregations/TermsAggregate.cs b/src/Elastic.Clients.Elasticsearch/Types/Aggregations/TermsAggregate.cs index e411204472c..72639e77612 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Aggregations/TermsAggregate.cs +++ b/src/Elastic.Clients.Elasticsearch/Types/Aggregations/TermsAggregate.cs @@ -15,7 +15,7 @@ public sealed class TermsAggregate : IAggregate [JsonInclude] [JsonPropertyName("sum_other_doc_count")] - public long SumOtherDocCount { get; init; } + public long? SumOtherDocCount { get; init; } [JsonInclude] [JsonPropertyName("buckets")] diff --git a/src/Elastic.Clients.Elasticsearch/Types/QueryDsl/QueryContainerDescriptor.cs b/src/Elastic.Clients.Elasticsearch/Types/QueryDsl/QueryContainerDescriptor.cs index 400feba5336..f68582497ea 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/QueryDsl/QueryContainerDescriptor.cs +++ b/src/Elastic.Clients.Elasticsearch/Types/QueryDsl/QueryContainerDescriptor.cs @@ -13,7 +13,7 @@ public void MatchAll() => Set(_ => { }, "match_all"); public void Term(Expression> field, object value, float? boost = null) => - Term(t => t.Field(field).Value(value).Boost(boost)); + Term(t => t.Field(field).Value(FieldValue.Composite(value)).Boost(boost)); } public sealed partial class QueryContainerDescriptor/**/ @@ -27,5 +27,5 @@ public void MatchAll() => // Term(t => t.Field(field).Value(value).Boost(boost).Name(name)); public void Term(Expression> field, object value, float? boost = null) => - Term(t => t.Field(field).Value(value).Boost(boost)); + Term(t => t.Field(field).Value(FieldValue.Composite(value)).Boost(boost)); } diff --git a/src/Elastic.Clients.Elasticsearch/Types/Sql/SqlValue.cs b/src/Elastic.Clients.Elasticsearch/Types/Sql/SqlValue.cs index 775f043b357..edd5d94d6c5 100644 --- a/src/Elastic.Clients.Elasticsearch/Types/Sql/SqlValue.cs +++ b/src/Elastic.Clients.Elasticsearch/Types/Sql/SqlValue.cs @@ -11,9 +11,9 @@ namespace Elastic.Clients.Elasticsearch.Sql; [JsonConverter(typeof(SqlValueConverter))] public readonly struct SqlValue { - private readonly LazyDocument _lazyDocument; + private readonly LazyJson _lazyDocument; - internal SqlValue(LazyDocument lazyDocument) => _lazyDocument = lazyDocument; + internal SqlValue(LazyJson lazyDocument) => _lazyDocument = lazyDocument; public T? As() => _lazyDocument.As(); } @@ -28,7 +28,7 @@ public override SqlValue Read(ref Utf8JsonReader reader, Type typeToConvert, Jso return default; } - var lazyDoc = JsonSerializer.Deserialize(ref reader, options); + var lazyDoc = JsonSerializer.Deserialize(ref reader, options); return new SqlValue(lazyDoc); } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchSubmitRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchSubmitRequest.g.cs index 0b360f860f0..b6792cfaf38 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchSubmitRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchSubmitRequest.g.cs @@ -234,7 +234,7 @@ public override AsyncSearchSubmitRequest Read(ref Utf8JsonReader reader, Type ty if (property == "search_after") { - variant.SearchAfter = JsonSerializer.Deserialize?>(ref reader, options); + variant.SearchAfter = JsonSerializer.Deserialize?>(ref reader, options); continue; } @@ -708,7 +708,7 @@ public AsyncSearchSubmitRequest(Elastic.Clients.Elasticsearch.Indices? indices) [JsonInclude] [JsonPropertyName("search_after")] - public IEnumerable? SearchAfter { get; set; } + public IEnumerable? SearchAfter { get; set; } [JsonInclude] [JsonPropertyName("size")] @@ -917,7 +917,7 @@ public AsyncSearchSubmitRequestDescriptor Indices(Elastic.Clients.Ela private Dictionary? ScriptFieldsValue { get; set; } - private IEnumerable? SearchAfterValue { get; set; } + private IEnumerable? SearchAfterValue { get; set; } private bool? SeqNoPrimaryTermValue { get; set; } @@ -1299,7 +1299,7 @@ public AsyncSearchSubmitRequestDescriptor ScriptFields(Func SearchAfter(IEnumerable? searchAfter) + public AsyncSearchSubmitRequestDescriptor SearchAfter(IEnumerable? searchAfter) { SearchAfterValue = searchAfter; return Self; @@ -1335,12 +1335,6 @@ public AsyncSearchSubmitRequestDescriptor StoredFields(Elastic.Client return Self; } - public AsyncSearchSubmitRequestDescriptor StoredFields(Expression> storedFields) - { - StoredFieldsValue = storedFields; - return Self; - } - public AsyncSearchSubmitRequestDescriptor Suggest(Elastic.Clients.Elasticsearch.Suggester? suggest) { SuggestDescriptor = null; @@ -1897,7 +1891,7 @@ public AsyncSearchSubmitRequestDescriptor Indices(Elastic.Clients.Elasticsearch. private Dictionary? ScriptFieldsValue { get; set; } - private IEnumerable? SearchAfterValue { get; set; } + private IEnumerable? SearchAfterValue { get; set; } private bool? SeqNoPrimaryTermValue { get; set; } @@ -2279,7 +2273,7 @@ public AsyncSearchSubmitRequestDescriptor ScriptFields(Func? searchAfter) + public AsyncSearchSubmitRequestDescriptor SearchAfter(IEnumerable? searchAfter) { SearchAfterValue = searchAfter; return Self; @@ -2315,18 +2309,6 @@ public AsyncSearchSubmitRequestDescriptor StoredFields(Elastic.Clients.Elasticse return Self; } - public AsyncSearchSubmitRequestDescriptor StoredFields(Expression> storedFields) - { - StoredFieldsValue = storedFields; - return Self; - } - - public AsyncSearchSubmitRequestDescriptor StoredFields(Expression> storedFields) - { - StoredFieldsValue = storedFields; - return Self; - } - public AsyncSearchSubmitRequestDescriptor Suggest(Elastic.Clients.Elasticsearch.Suggester? suggest) { SuggestDescriptor = null; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRethrottleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRethrottleRequest.g.cs index 83b3b7d39e9..449180cbe49 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRethrottleRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRethrottleRequest.g.cs @@ -33,7 +33,7 @@ public sealed class DeleteByQueryRethrottleRequestParameters : RequestParameters public sealed partial class DeleteByQueryRethrottleRequest : PlainRequestBase { - public DeleteByQueryRethrottleRequest(Elastic.Clients.Elasticsearch.Id task_id) : base(r => r.Required("task_id", task_id)) + public DeleteByQueryRethrottleRequest(Elastic.Clients.Elasticsearch.TaskId task_id) : base(r => r.Required("task_id", task_id)) { } @@ -47,7 +47,7 @@ public DeleteByQueryRethrottleRequest(Elastic.Clients.Elasticsearch.Id task_id) public sealed partial class DeleteByQueryRethrottleRequestDescriptor : RequestDescriptorBase { internal DeleteByQueryRethrottleRequestDescriptor(Action configure) => configure.Invoke(this); - public DeleteByQueryRethrottleRequestDescriptor(Elastic.Clients.Elasticsearch.Id task_id) : base(r => r.Required("task_id", task_id)) + public DeleteByQueryRethrottleRequestDescriptor(Elastic.Clients.Elasticsearch.TaskId task_id) : base(r => r.Required("task_id", task_id)) { } @@ -59,7 +59,7 @@ internal DeleteByQueryRethrottleRequestDescriptor() protected override HttpMethod HttpMethod => HttpMethod.POST; protected override bool SupportsBody => false; public DeleteByQueryRethrottleRequestDescriptor RequestsPerSecond(float? requestsPerSecond) => Qs("requests_per_second", requestsPerSecond); - public DeleteByQueryRethrottleRequestDescriptor TaskId(Elastic.Clients.Elasticsearch.Id task_id) + public DeleteByQueryRethrottleRequestDescriptor TaskId(Elastic.Clients.Elasticsearch.TaskId task_id) { RouteValues.Required("task_id", task_id); return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/FieldCapsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/FieldCapsRequest.g.cs index c393d76d950..3db09548b9c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/FieldCapsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/FieldCapsRequest.g.cs @@ -34,7 +34,7 @@ public sealed class FieldCapsRequestParameters : RequestParameters? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } [JsonIgnore] - public Elastic.Clients.Elasticsearch.Fields Fields { get => Q("fields"); set => Q("fields", value); } + public Elastic.Clients.Elasticsearch.Fields? Fields { get => Q("fields"); set => Q("fields", value); } [JsonIgnore] public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } @@ -69,7 +69,7 @@ public FieldCapsRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r public IEnumerable? ExpandWildcards { get => Q?>("expand_wildcards"); set => Q("expand_wildcards", value); } [JsonIgnore] - public Elastic.Clients.Elasticsearch.Fields Fields { get => Q("fields"); set => Q("fields", value); } + public Elastic.Clients.Elasticsearch.Fields? Fields { get => Q("fields"); set => Q("fields", value); } [JsonIgnore] public bool? IgnoreUnavailable { get => Q("ignore_unavailable"); set => Q("ignore_unavailable", value); } @@ -104,7 +104,7 @@ public FieldCapsRequestDescriptor() protected override bool SupportsBody => true; public FieldCapsRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); public FieldCapsRequestDescriptor ExpandWildcards(IEnumerable? expandWildcards) => Qs("expand_wildcards", expandWildcards); - public FieldCapsRequestDescriptor Fields(Elastic.Clients.Elasticsearch.Fields fields) => Qs("fields", fields); + public FieldCapsRequestDescriptor Fields(Elastic.Clients.Elasticsearch.Fields? fields) => Qs("fields", fields); public FieldCapsRequestDescriptor Filters(string? filters) => Qs("filters", filters); public FieldCapsRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); public FieldCapsRequestDescriptor IncludeUnmapped(bool? includeUnmapped = true) => Qs("include_unmapped", includeUnmapped); @@ -194,7 +194,7 @@ public FieldCapsRequestDescriptor() protected override bool SupportsBody => true; public FieldCapsRequestDescriptor AllowNoIndices(bool? allowNoIndices = true) => Qs("allow_no_indices", allowNoIndices); public FieldCapsRequestDescriptor ExpandWildcards(IEnumerable? expandWildcards) => Qs("expand_wildcards", expandWildcards); - public FieldCapsRequestDescriptor Fields(Elastic.Clients.Elasticsearch.Fields fields) => Qs("fields", fields); + public FieldCapsRequestDescriptor Fields(Elastic.Clients.Elasticsearch.Fields? fields) => Qs("fields", fields); public FieldCapsRequestDescriptor Filters(string? filters) => Qs("filters", filters); public FieldCapsRequestDescriptor IgnoreUnavailable(bool? ignoreUnavailable = true) => Qs("ignore_unavailable", ignoreUnavailable); public FieldCapsRequestDescriptor IncludeUnmapped(bool? includeUnmapped = true) => Qs("include_unmapped", includeUnmapped); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ForcemergeResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ForcemergeResponse.g.cs index 49bf0d014d5..6fb09ec9ad4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ForcemergeResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ForcemergeResponse.g.cs @@ -27,5 +27,9 @@ public sealed partial class ForcemergeResponse : ElasticsearchResponseBase [JsonInclude] [JsonPropertyName("_shards")] public Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; init; } + + [JsonInclude] + [JsonPropertyName("task")] + public string? Task { get; init; } } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs index 63bd25b5329..5293f3db6fc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs @@ -225,7 +225,7 @@ public override SearchRequest Read(ref Utf8JsonReader reader, Type typeToConvert if (property == "search_after") { - variant.SearchAfter = JsonSerializer.Deserialize?>(ref reader, options); + variant.SearchAfter = JsonSerializer.Deserialize?>(ref reader, options); continue; } @@ -690,7 +690,7 @@ public SearchRequest(Elastic.Clients.Elasticsearch.Indices? indices) : base(r => [JsonInclude] [JsonPropertyName("search_after")] - public IEnumerable? SearchAfter { get; set; } + public IEnumerable? SearchAfter { get; set; } [JsonInclude] [JsonPropertyName("size")] @@ -900,7 +900,7 @@ public SearchRequestDescriptor Indices(Elastic.Clients.Elasticsearch. private Dictionary? ScriptFieldsValue { get; set; } - private IEnumerable? SearchAfterValue { get; set; } + private IEnumerable? SearchAfterValue { get; set; } private bool? SeqNoPrimaryTermValue { get; set; } @@ -1282,7 +1282,7 @@ public SearchRequestDescriptor ScriptFields(Func SearchAfter(IEnumerable? searchAfter) + public SearchRequestDescriptor SearchAfter(IEnumerable? searchAfter) { SearchAfterValue = searchAfter; return Self; @@ -1318,12 +1318,6 @@ public SearchRequestDescriptor StoredFields(Elastic.Clients.Elasticse return Self; } - public SearchRequestDescriptor StoredFields(Expression> storedFields) - { - StoredFieldsValue = storedFields; - return Self; - } - public SearchRequestDescriptor Suggest(Elastic.Clients.Elasticsearch.Suggester? suggest) { SuggestDescriptor = null; @@ -1881,7 +1875,7 @@ public SearchRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? in private Dictionary? ScriptFieldsValue { get; set; } - private IEnumerable? SearchAfterValue { get; set; } + private IEnumerable? SearchAfterValue { get; set; } private bool? SeqNoPrimaryTermValue { get; set; } @@ -2263,7 +2257,7 @@ public SearchRequestDescriptor ScriptFields(Func? searchAfter) + public SearchRequestDescriptor SearchAfter(IEnumerable? searchAfter) { SearchAfterValue = searchAfter; return Self; @@ -2299,18 +2293,6 @@ public SearchRequestDescriptor StoredFields(Elastic.Clients.Elasticsearch.Fields return Self; } - public SearchRequestDescriptor StoredFields(Expression> storedFields) - { - StoredFieldsValue = storedFields; - return Self; - } - - public SearchRequestDescriptor StoredFields(Expression> storedFields) - { - StoredFieldsValue = storedFields; - return Self; - } - public SearchRequestDescriptor Suggest(Elastic.Clients.Elasticsearch.Suggester? suggest) { SuggestDescriptor = null; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs index 2230022dfcd..85331e54fdf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs @@ -390,14 +390,14 @@ public Task DeleteByQueryRethrottleAsync(Delete return DoRequestAsync(request, cancellationToken); } - public DeleteByQueryRethrottleResponse DeleteByQueryRethrottle(Elastic.Clients.Elasticsearch.Id task_id) + public DeleteByQueryRethrottleResponse DeleteByQueryRethrottle(Elastic.Clients.Elasticsearch.TaskId task_id) { var descriptor = new DeleteByQueryRethrottleRequestDescriptor(task_id); descriptor.BeforeRequest(); return DoRequest(descriptor); } - public DeleteByQueryRethrottleResponse DeleteByQueryRethrottle(Elastic.Clients.Elasticsearch.Id task_id, Action configureRequest) + public DeleteByQueryRethrottleResponse DeleteByQueryRethrottle(Elastic.Clients.Elasticsearch.TaskId task_id, Action configureRequest) { var descriptor = new DeleteByQueryRethrottleRequestDescriptor(task_id); configureRequest?.Invoke(descriptor); @@ -405,14 +405,14 @@ public DeleteByQueryRethrottleResponse DeleteByQueryRethrottle(Elastic.Clients.E return DoRequest(descriptor); } - public Task DeleteByQueryRethrottleAsync(Elastic.Clients.Elasticsearch.Id task_id, CancellationToken cancellationToken = default) + public Task DeleteByQueryRethrottleAsync(Elastic.Clients.Elasticsearch.TaskId task_id, CancellationToken cancellationToken = default) { var descriptor = new DeleteByQueryRethrottleRequestDescriptor(task_id); descriptor.BeforeRequest(); return DoRequestAsync(descriptor); } - public Task DeleteByQueryRethrottleAsync(Elastic.Clients.Elasticsearch.Id task_id, Action configureRequest, CancellationToken cancellationToken = default) + public Task DeleteByQueryRethrottleAsync(Elastic.Clients.Elasticsearch.TaskId task_id, Action configureRequest, CancellationToken cancellationToken = default) { var descriptor = new DeleteByQueryRethrottleRequestDescriptor(task_id); configureRequest?.Invoke(descriptor); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/AggregationProfileDebug.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/AggregationProfileDebug.g.cs index 9d1e49fff47..602882fc5ac 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/AggregationProfileDebug.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/AggregationProfileDebug.g.cs @@ -78,6 +78,10 @@ public sealed partial class AggregationProfileDebug [JsonPropertyName("has_filter")] public bool? HasFilter { get; init; } + [JsonInclude] + [JsonPropertyName("map_reducer")] + public string? MapReducer { get; init; } + [JsonInclude] [JsonPropertyName("numeric_collectors_used")] public int? NumericCollectorsUsed { get; init; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/AggregationProfileDelegateDebugFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/AggregationProfileDelegateDebugFilter.g.cs index bfafa000808..6afa8420c7e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/AggregationProfileDelegateDebugFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/AggregationProfileDelegateDebugFilter.g.cs @@ -34,6 +34,10 @@ public sealed partial class AggregationProfileDelegateDebugFilter [JsonPropertyName("results_from_metadata")] public int? ResultsFromMetadata { get; init; } + [JsonInclude] + [JsonPropertyName("segments_counted_in_constant_time")] + public int? SegmentsCountedInConstantTime { get; init; } + [JsonInclude] [JsonPropertyName("specialized_for")] public string? SpecializedFor { get; init; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AdjacencyMatrixBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AdjacencyMatrixBucket.g.cs index c930563dd66..366a013e159 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AdjacencyMatrixBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AdjacencyMatrixBucket.g.cs @@ -34,6 +34,10 @@ public AdjacencyMatrixBucket(IReadOnlyDictionary backingDict [JsonInclude] [JsonPropertyName("doc_count")] public long DocCount { get; init; } + + [JsonInclude] + [JsonPropertyName("key")] + public string Key { get; init; } } internal sealed class AdjacencyMatrixBucketConverter : JsonConverter @@ -44,6 +48,7 @@ internal sealed class AdjacencyMatrixBucketConverter : JsonConverter(); // TODO - Optimise this and only create if we need it. long docCount = default; + string key = default; while (reader.Read()) { if (reader.TokenType == JsonTokenType.EndObject) @@ -58,6 +63,12 @@ internal sealed class AdjacencyMatrixBucketConverter : JsonConverter(ref reader, options); + continue; + } + if (name.Contains("#")) { AggregateDictionaryConverter.ReadAggregate(ref reader, options, subAggs, name); @@ -68,7 +79,7 @@ internal sealed class AdjacencyMatrixBucketConverter : JsonConverter throw new NotImplementedException(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregation.g.cs index 1de9db3f094..6f54faede02 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AverageAggregation.g.cs @@ -63,6 +63,18 @@ public override AverageAggregation Read(ref Utf8JsonReader reader, Type typeToCo continue; } + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + if (reader.ValueTextEquals("script")) { reader.Read(); @@ -114,6 +126,12 @@ public override void Write(Utf8JsonWriter writer, AverageAggregation value, Json writer.WriteStringValue(value.Format); } + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + if (value.Script is not null) { writer.WritePropertyName("script"); @@ -146,6 +164,8 @@ internal AverageAggregation() public Dictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + public override string? Name { get; internal set; } public Elastic.Clients.Elasticsearch.Script? Script { get; set; } @@ -164,6 +184,8 @@ public AverageAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } public AverageAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) @@ -190,6 +212,12 @@ public AverageAggregationDescriptor Meta(Func Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + public AverageAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) { ScriptValue = script; @@ -213,6 +241,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + if (ScriptValue is not null) { writer.WritePropertyName("script"); @@ -243,6 +277,8 @@ public AverageAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } public AverageAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) @@ -275,6 +311,12 @@ public AverageAggregationDescriptor Meta(Func, return Self; } + public AverageAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + public AverageAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) { ScriptValue = script; @@ -298,6 +340,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + if (ScriptValue is not null) { writer.WritePropertyName("script"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BoxplotAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BoxplotAggregation.g.cs index d5059cf46ec..a930629d6ef 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BoxplotAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/BoxplotAggregation.g.cs @@ -63,6 +63,18 @@ public override BoxplotAggregation Read(ref Utf8JsonReader reader, Type typeToCo continue; } + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + if (reader.ValueTextEquals("script")) { reader.Read(); @@ -114,6 +126,12 @@ public override void Write(Utf8JsonWriter writer, BoxplotAggregation value, Json JsonSerializer.Serialize(writer, value.Field, options); } + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + if (value.Script is not null) { writer.WritePropertyName("script"); @@ -146,6 +164,8 @@ internal BoxplotAggregation() public Dictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + public override string? Name { get; internal set; } public Elastic.Clients.Elasticsearch.Script? Script { get; set; } @@ -164,6 +184,8 @@ public BoxplotAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } public BoxplotAggregationDescriptor Compression(double? compression) @@ -190,6 +212,12 @@ public BoxplotAggregationDescriptor Meta(Func Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + public BoxplotAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) { ScriptValue = script; @@ -213,6 +241,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FieldValue, options); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + if (ScriptValue is not null) { writer.WritePropertyName("script"); @@ -243,6 +277,8 @@ public BoxplotAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } public BoxplotAggregationDescriptor Compression(double? compression) @@ -275,6 +311,12 @@ public BoxplotAggregationDescriptor Meta(Func, return Self; } + public BoxplotAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + public BoxplotAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) { ScriptValue = script; @@ -298,6 +340,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FieldValue, options); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + if (ScriptValue is not null) { writer.WritePropertyName("script"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityAggregation.g.cs index 56f35b767b9..9ef2db49d93 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CardinalityAggregation.g.cs @@ -63,6 +63,18 @@ public override CardinalityAggregation Read(ref Utf8JsonReader reader, Type type continue; } + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + if (reader.ValueTextEquals("precision_threshold")) { reader.Read(); @@ -138,6 +150,12 @@ public override void Write(Utf8JsonWriter writer, CardinalityAggregation value, JsonSerializer.Serialize(writer, value.Field, options); } + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + if (value.PrecisionThreshold.HasValue) { writer.WritePropertyName("precision_threshold"); @@ -182,6 +200,8 @@ internal CardinalityAggregation() public Dictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + public override string? Name { get; internal set; } public int? PrecisionThreshold { get; set; } @@ -204,6 +224,8 @@ public CardinalityAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private int? PrecisionThresholdValue { get; set; } private bool? RehashValue { get; set; } @@ -234,6 +256,12 @@ public CardinalityAggregationDescriptor Meta(Func Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + public CardinalityAggregationDescriptor PrecisionThreshold(int? precisionThreshold) { PrecisionThresholdValue = precisionThreshold; @@ -269,6 +297,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FieldValue, options); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + if (PrecisionThresholdValue.HasValue) { writer.WritePropertyName("precision_threshold"); @@ -311,6 +345,8 @@ public CardinalityAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private int? PrecisionThresholdValue { get; set; } private bool? RehashValue { get; set; } @@ -347,6 +383,12 @@ public CardinalityAggregationDescriptor Meta(Func? AfterKey { get; init; } + public Dictionary? AfterKey { get; init; } [JsonInclude] [JsonPropertyName("buckets")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregation.g.cs index 3d5e6796d11..11f0eb6f346 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeAggregation.g.cs @@ -42,7 +42,7 @@ public override CompositeAggregation Read(ref Utf8JsonReader reader, Type typeTo if (reader.ValueTextEquals("after")) { reader.Read(); - var value = JsonSerializer.Deserialize?>(ref reader, options); + var value = JsonSerializer.Deserialize?>(ref reader, options); if (value is not null) { agg.After = value; @@ -156,7 +156,7 @@ internal CompositeAggregation() { } - public Dictionary? After { get; set; } + public Dictionary? After { get; set; } public Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? Aggregations { get; set; } @@ -182,7 +182,7 @@ public CompositeAggregationDescriptor() : base() private Action> AggregationsDescriptorAction { get; set; } - private Dictionary? AfterValue { get; set; } + private Dictionary? AfterValue { get; set; } private Dictionary? MetaValue { get; set; } @@ -214,9 +214,9 @@ public CompositeAggregationDescriptor Aggregations(Action After(Func, FluentDictionary> selector) + public CompositeAggregationDescriptor After(Func, FluentDictionary> selector) { - AfterValue = selector?.Invoke(new FluentDictionary()); + AfterValue = selector?.Invoke(new FluentDictionary()); return Self; } @@ -301,7 +301,7 @@ public CompositeAggregationDescriptor() : base() private Action AggregationsDescriptorAction { get; set; } - private Dictionary? AfterValue { get; set; } + private Dictionary? AfterValue { get; set; } private Dictionary? MetaValue { get; set; } @@ -333,9 +333,9 @@ public CompositeAggregationDescriptor Aggregations(Action, FluentDictionary> selector) + public CompositeAggregationDescriptor After(Func, FluentDictionary> selector) { - AfterValue = selector?.Invoke(new FluentDictionary()); + AfterValue = selector?.Invoke(new FluentDictionary()); return Self; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeBucket.g.cs index 48cbff0ecd0..53a73e506d9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CompositeBucket.g.cs @@ -37,7 +37,7 @@ public CompositeBucket(IReadOnlyDictionary backingDictionary [JsonInclude] [JsonPropertyName("key")] - public Dictionary Key { get; init; } + public Dictionary Key { get; init; } } internal sealed class CompositeBucketConverter : JsonConverter @@ -48,7 +48,7 @@ internal sealed class CompositeBucketConverter : JsonConverter throw new JsonException($"Expected {JsonTokenType.StartObject} but read {reader.TokenType}."); var subAggs = new Dictionary(); // TODO - Optimise this and only create if we need it. long docCount = default; - Dictionary key = default; + Dictionary key = default; while (reader.Read()) { if (reader.TokenType == JsonTokenType.EndObject) @@ -65,7 +65,7 @@ internal sealed class CompositeBucketConverter : JsonConverter if (name.Equals("key", StringComparison.Ordinal)) { - key = JsonSerializer.Deserialize>(ref reader, options); + key = JsonSerializer.Deserialize>(ref reader, options); continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeAggregation.g.cs index 76044f50ed7..cc902c6a90a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DateRangeAggregation.g.cs @@ -63,6 +63,18 @@ public override DateRangeAggregation Read(ref Utf8JsonReader reader, Type typeTo continue; } + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + if (reader.ValueTextEquals("ranges")) { reader.Read(); @@ -137,6 +149,12 @@ public override void Write(Utf8JsonWriter writer, DateRangeAggregation value, Js writer.WriteStringValue(value.Format); } + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + if (value.Ranges is not null) { writer.WritePropertyName("ranges"); @@ -182,6 +200,8 @@ internal DateRangeAggregation() public Dictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + public override string? Name { get; internal set; } public IEnumerable? Ranges { get; set; } @@ -208,6 +228,8 @@ public DateRangeAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private IEnumerable? RangesValue { get; set; } private DateRangeExpressionDescriptor RangesDescriptor { get; set; } @@ -266,6 +288,12 @@ public DateRangeAggregationDescriptor Meta(Func Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + public DateRangeAggregationDescriptor Ranges(IEnumerable? ranges) { RangesDescriptor = null; @@ -325,6 +353,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + if (RangesDescriptor is not null) { writer.WritePropertyName("ranges"); @@ -408,6 +442,8 @@ public DateRangeAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private IEnumerable? RangesValue { get; set; } private DateRangeExpressionDescriptor RangesDescriptor { get; set; } @@ -472,6 +508,12 @@ public DateRangeAggregationDescriptor Meta(Func return Self; } + public DateRangeAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + public DateRangeAggregationDescriptor Ranges(IEnumerable? ranges) { RangesDescriptor = null; @@ -531,6 +573,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + if (RangesDescriptor is not null) { writer.WritePropertyName("ranges"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DoubleTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DoubleTermsAggregate.g.cs index 02318caf277..01afe2492f0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DoubleTermsAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DoubleTermsAggregate.g.cs @@ -40,6 +40,6 @@ public sealed partial class DoubleTermsAggregate : IAggregate [JsonInclude] [JsonPropertyName("sum_other_doc_count")] - public long SumOtherDocCount { get; init; } + public long? SumOtherDocCount { get; init; } } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregate.g.cs index 070b6800714..c382b6602fe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregate.g.cs @@ -74,6 +74,14 @@ public sealed partial class ExtendedStatsAggregate : IAggregate [JsonPropertyName("std_deviation_bounds_as_string")] public Elastic.Clients.Elasticsearch.Aggregations.StandardDeviationBoundsAsString? StdDeviationBoundsAsString { get; init; } + [JsonInclude] + [JsonPropertyName("std_deviation_population")] + public double? StdDeviationPopulation { get; init; } + + [JsonInclude] + [JsonPropertyName("std_deviation_sampling")] + public double? StdDeviationSampling { get; init; } + [JsonInclude] [JsonPropertyName("sum")] public double Sum { get; init; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregation.g.cs index 7a89c0c9246..6c296049e99 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ExtendedStatsAggregation.g.cs @@ -63,6 +63,18 @@ public override ExtendedStatsAggregation Read(ref Utf8JsonReader reader, Type ty continue; } + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + if (reader.ValueTextEquals("script")) { reader.Read(); @@ -126,6 +138,12 @@ public override void Write(Utf8JsonWriter writer, ExtendedStatsAggregation value writer.WriteStringValue(value.Format); } + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + if (value.Script is not null) { writer.WritePropertyName("script"); @@ -164,6 +182,8 @@ internal ExtendedStatsAggregation() public Dictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + public override string? Name { get; internal set; } public Elastic.Clients.Elasticsearch.Script? Script { get; set; } @@ -184,6 +204,8 @@ public ExtendedStatsAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private double? SigmaValue { get; set; } @@ -212,6 +234,12 @@ public ExtendedStatsAggregationDescriptor Meta(Func Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + public ExtendedStatsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) { ScriptValue = script; @@ -241,6 +269,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + if (ScriptValue is not null) { writer.WritePropertyName("script"); @@ -277,6 +311,8 @@ public ExtendedStatsAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private double? SigmaValue { get; set; } @@ -311,6 +347,12 @@ public ExtendedStatsAggregationDescriptor Meta(Func backingDictionary) [JsonPropertyName("from")] public string? From { get; init; } + [JsonInclude] + [JsonPropertyName("key")] + public string? Key { get; init; } + [JsonInclude] [JsonPropertyName("to")] public string? To { get; init; } @@ -53,6 +57,7 @@ internal sealed class IpRangeBucketConverter : JsonConverter var subAggs = new Dictionary(); // TODO - Optimise this and only create if we need it. long docCount = default; string? from = default; + string? key = default; string? to = default; while (reader.Read()) { @@ -74,6 +79,12 @@ internal sealed class IpRangeBucketConverter : JsonConverter continue; } + if (name.Equals("key", StringComparison.Ordinal)) + { + key = JsonSerializer.Deserialize(ref reader, options); + continue; + } + if (name.Equals("to", StringComparison.Ordinal)) { to = JsonSerializer.Deserialize(ref reader, options); @@ -90,7 +101,7 @@ internal sealed class IpRangeBucketConverter : JsonConverter } return new IpRangeBucket(subAggs) - { DocCount = docCount, From = from, To = to }; + { DocCount = docCount, From = from, Key = key, To = to }; } public override void Write(Utf8JsonWriter writer, IpRangeBucket value, JsonSerializerOptions options) => throw new NotImplementedException(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongTermsAggregate.g.cs index 4063b1848ab..eb08d39a166 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongTermsAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/LongTermsAggregate.g.cs @@ -40,6 +40,6 @@ public sealed partial class LongTermsAggregate : IAggregate [JsonInclude] [JsonPropertyName("sum_other_doc_count")] - public long SumOtherDocCount { get; init; } + public long? SumOtherDocCount { get; init; } } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsAggregation.g.cs index 56c583889b0..e732f6bf064 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MatrixStatsAggregation.g.cs @@ -171,12 +171,6 @@ public MatrixStatsAggregationDescriptor Fields(Elastic.Clients.Elasti return Self; } - public MatrixStatsAggregationDescriptor Fields(Expression> fields) - { - FieldsValue = fields; - return Self; - } - public MatrixStatsAggregationDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); @@ -250,18 +244,6 @@ public MatrixStatsAggregationDescriptor Fields(Elastic.Clients.Elasticsearch.Fie return Self; } - public MatrixStatsAggregationDescriptor Fields(Expression> fields) - { - FieldsValue = fields; - return Self; - } - - public MatrixStatsAggregationDescriptor Fields(Expression> fields) - { - FieldsValue = fields; - return Self; - } - public MatrixStatsAggregationDescriptor Meta(Func, FluentDictionary> selector) { MetaValue = selector?.Invoke(new FluentDictionary()); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregation.g.cs index 3172b23bb50..dc94d530e9f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MaxAggregation.g.cs @@ -63,6 +63,18 @@ public override MaxAggregation Read(ref Utf8JsonReader reader, Type typeToConver continue; } + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + if (reader.ValueTextEquals("script")) { reader.Read(); @@ -114,6 +126,12 @@ public override void Write(Utf8JsonWriter writer, MaxAggregation value, JsonSeri writer.WriteStringValue(value.Format); } + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + if (value.Script is not null) { writer.WritePropertyName("script"); @@ -146,6 +164,8 @@ internal MaxAggregation() public Dictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + public override string? Name { get; internal set; } public Elastic.Clients.Elasticsearch.Script? Script { get; set; } @@ -164,6 +184,8 @@ public MaxAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } public MaxAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) @@ -190,6 +212,12 @@ public MaxAggregationDescriptor Meta(Func Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + public MaxAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) { ScriptValue = script; @@ -213,6 +241,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + if (ScriptValue is not null) { writer.WritePropertyName("script"); @@ -243,6 +277,8 @@ public MaxAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } public MaxAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) @@ -275,6 +311,12 @@ public MaxAggregationDescriptor Meta(Func, Flue return Self; } + public MaxAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + public MaxAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) { ScriptValue = script; @@ -298,6 +340,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + if (ScriptValue is not null) { writer.WritePropertyName("script"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregation.g.cs index 01ba9660c3b..88b35e2d3c4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MedianAbsoluteDeviationAggregation.g.cs @@ -75,6 +75,18 @@ public override MedianAbsoluteDeviationAggregation Read(ref Utf8JsonReader reade continue; } + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + if (reader.ValueTextEquals("script")) { reader.Read(); @@ -132,6 +144,12 @@ public override void Write(Utf8JsonWriter writer, MedianAbsoluteDeviationAggrega writer.WriteStringValue(value.Format); } + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + if (value.Script is not null) { writer.WritePropertyName("script"); @@ -166,6 +184,8 @@ internal MedianAbsoluteDeviationAggregation() public Dictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + public override string? Name { get; internal set; } public Elastic.Clients.Elasticsearch.Script? Script { get; set; } @@ -186,6 +206,8 @@ public MedianAbsoluteDeviationAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } public MedianAbsoluteDeviationAggregationDescriptor Compression(double? compression) @@ -218,6 +240,12 @@ public MedianAbsoluteDeviationAggregationDescriptor Meta(Func Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + public MedianAbsoluteDeviationAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) { ScriptValue = script; @@ -247,6 +275,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + if (ScriptValue is not null) { writer.WritePropertyName("script"); @@ -279,6 +313,8 @@ public MedianAbsoluteDeviationAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } public MedianAbsoluteDeviationAggregationDescriptor Compression(double? compression) @@ -317,6 +353,12 @@ public MedianAbsoluteDeviationAggregationDescriptor Meta(Func(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + if (reader.ValueTextEquals("script")) { reader.Read(); @@ -114,6 +126,12 @@ public override void Write(Utf8JsonWriter writer, MinAggregation value, JsonSeri writer.WriteStringValue(value.Format); } + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + if (value.Script is not null) { writer.WritePropertyName("script"); @@ -146,6 +164,8 @@ internal MinAggregation() public Dictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + public override string? Name { get; internal set; } public Elastic.Clients.Elasticsearch.Script? Script { get; set; } @@ -164,6 +184,8 @@ public MinAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } public MinAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) @@ -190,6 +212,12 @@ public MinAggregationDescriptor Meta(Func Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + public MinAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) { ScriptValue = script; @@ -213,6 +241,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + if (ScriptValue is not null) { writer.WritePropertyName("script"); @@ -243,6 +277,8 @@ public MinAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } public MinAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) @@ -275,6 +311,12 @@ public MinAggregationDescriptor Meta(Func, Flue return Self; } + public MinAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + public MinAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) { ScriptValue = script; @@ -298,6 +340,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + if (ScriptValue is not null) { writer.WritePropertyName("script"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregation.g.cs index 5d24a220ad2..f6127bce6ab 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MissingAggregation.g.cs @@ -50,6 +50,18 @@ public override MissingAggregation Read(ref Utf8JsonReader reader, Type typeToCo continue; } + + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } } } @@ -95,6 +107,12 @@ public override void Write(Utf8JsonWriter writer, MissingAggregation value, Json JsonSerializer.Serialize(writer, value.Field, options); } + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + writer.WriteEndObject(); if (value.Meta is not null) { @@ -126,6 +144,8 @@ internal MissingAggregation() public Dictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + public override string? Name { get; internal set; } } @@ -146,6 +166,8 @@ public MissingAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + public MissingAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) { AggregationsDescriptor = null; @@ -188,6 +210,12 @@ public MissingAggregationDescriptor Meta(Func Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); @@ -199,6 +227,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FieldValue, options); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + writer.WriteEndObject(); if (MetaValue is not null) { @@ -243,6 +277,8 @@ public MissingAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + public MissingAggregationDescriptor Aggregations(Elastic.Clients.Elasticsearch.Aggregations.AggregationDictionary? aggregations) { AggregationsDescriptor = null; @@ -291,6 +327,12 @@ public MissingAggregationDescriptor Meta(Func, return Self; } + public MissingAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); @@ -302,6 +344,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FieldValue, options); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + writer.WriteEndObject(); if (MetaValue is not null) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsAggregate.g.cs index f792f7c5214..cdc2f450170 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsAggregate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsAggregate.g.cs @@ -40,6 +40,6 @@ public sealed partial class MultiTermsAggregate : IAggregate [JsonInclude] [JsonPropertyName("sum_other_doc_count")] - public long SumOtherDocCount { get; init; } + public long? SumOtherDocCount { get; init; } } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsBucket.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsBucket.g.cs index 22e46acd058..60cb3acd8ec 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsBucket.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/MultiTermsBucket.g.cs @@ -41,7 +41,7 @@ public MultiTermsBucket(IReadOnlyDictionary backingDictionar [JsonInclude] [JsonPropertyName("key")] - public IReadOnlyCollection Key { get; init; } + public IReadOnlyCollection Key { get; init; } [JsonInclude] [JsonPropertyName("key_as_string")] @@ -57,7 +57,7 @@ internal sealed class MultiTermsBucketConverter : JsonConverter(); // TODO - Optimise this and only create if we need it. long docCount = default; long? docCountErrorUpperBound = default; - IReadOnlyCollection key = default; + IReadOnlyCollection key = default; string? keyAsString = default; while (reader.Read()) { @@ -81,7 +81,7 @@ internal sealed class MultiTermsBucketConverter : JsonConverter>(ref reader, options); + key = JsonSerializer.Deserialize>(ref reader, options); continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateAggregation.g.cs index 6f2d5a15843..b5ab21ccf8e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/RateAggregation.g.cs @@ -63,6 +63,18 @@ public override RateAggregation Read(ref Utf8JsonReader reader, Type typeToConve continue; } + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + if (reader.ValueTextEquals("mode")) { reader.Read(); @@ -138,6 +150,12 @@ public override void Write(Utf8JsonWriter writer, RateAggregation value, JsonSer writer.WriteStringValue(value.Format); } + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + if (value.Mode is not null) { writer.WritePropertyName("mode"); @@ -182,6 +200,8 @@ internal RateAggregation() public Dictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + public Elastic.Clients.Elasticsearch.Aggregations.RateMode? Mode { get; set; } public override string? Name { get; internal set; } @@ -204,6 +224,8 @@ public RateAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.RateMode? ModeValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } @@ -234,6 +256,12 @@ public RateAggregationDescriptor Meta(Func Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + public RateAggregationDescriptor Mode(Elastic.Clients.Elasticsearch.Aggregations.RateMode? mode) { ModeValue = mode; @@ -269,6 +297,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + if (ModeValue is not null) { writer.WritePropertyName("mode"); @@ -311,6 +345,8 @@ public RateAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Aggregations.RateMode? ModeValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } @@ -347,6 +383,12 @@ public RateAggregationDescriptor Meta(Func, Flu return Self; } + public RateAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + public RateAggregationDescriptor Mode(Elastic.Clients.Elasticsearch.Aggregations.RateMode? mode) { ModeValue = mode; @@ -382,6 +424,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + if (ModeValue is not null) { writer.WritePropertyName("mode"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedMetricAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedMetricAggregation.g.cs index d183246e977..ec8b03ff807 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedMetricAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ScriptedMetricAggregation.g.cs @@ -87,6 +87,18 @@ public override ScriptedMetricAggregation Read(ref Utf8JsonReader reader, Type t continue; } + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + if (reader.ValueTextEquals("params")) { reader.Read(); @@ -174,6 +186,12 @@ public override void Write(Utf8JsonWriter writer, ScriptedMetricAggregation valu JsonSerializer.Serialize(writer, value.MapScript, options); } + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + if (value.Params is not null) { writer.WritePropertyName("params"); @@ -222,6 +240,8 @@ internal ScriptedMetricAggregation() public Dictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + public override string? Name { get; internal set; } public Dictionary? Params { get; set; } @@ -248,6 +268,8 @@ public ScriptedMetricAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Dictionary? ParamsValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ReduceScriptValue { get; set; } @@ -290,6 +312,12 @@ public ScriptedMetricAggregationDescriptor Meta(Func Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + public ScriptedMetricAggregationDescriptor Params(Func, FluentDictionary> selector) { ParamsValue = selector?.Invoke(new FluentDictionary()); @@ -337,6 +365,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MapScriptValue, options); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + if (ParamsValue is not null) { writer.WritePropertyName("params"); @@ -383,6 +417,8 @@ public ScriptedMetricAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Dictionary? ParamsValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ReduceScriptValue { get; set; } @@ -431,6 +467,12 @@ public ScriptedMetricAggregationDescriptor Meta(Func, FluentDictionary> selector) { ParamsValue = selector?.Invoke(new FluentDictionary()); @@ -478,6 +520,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MapScriptValue, options); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + if (ParamsValue is not null) { writer.WritePropertyName("params"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsAggregation.g.cs index ede27767a52..00202a0defd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StatsAggregation.g.cs @@ -63,6 +63,18 @@ public override StatsAggregation Read(ref Utf8JsonReader reader, Type typeToConv continue; } + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + if (reader.ValueTextEquals("script")) { reader.Read(); @@ -114,6 +126,12 @@ public override void Write(Utf8JsonWriter writer, StatsAggregation value, JsonSe writer.WriteStringValue(value.Format); } + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + if (value.Script is not null) { writer.WritePropertyName("script"); @@ -146,6 +164,8 @@ internal StatsAggregation() public Dictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + public override string? Name { get; internal set; } public Elastic.Clients.Elasticsearch.Script? Script { get; set; } @@ -164,6 +184,8 @@ public StatsAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } public StatsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) @@ -190,6 +212,12 @@ public StatsAggregationDescriptor Meta(Func Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + public StatsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) { ScriptValue = script; @@ -213,6 +241,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + if (ScriptValue is not null) { writer.WritePropertyName("script"); @@ -243,6 +277,8 @@ public StatsAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } public StatsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) @@ -275,6 +311,12 @@ public StatsAggregationDescriptor Meta(Func, Fl return Self; } + public StatsAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + public StatsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) { ScriptValue = script; @@ -298,6 +340,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + if (ScriptValue is not null) { writer.WritePropertyName("script"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringStatsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringStatsAggregation.g.cs index f2ab2f70dce..436f8a9d3d4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringStatsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StringStatsAggregation.g.cs @@ -51,6 +51,18 @@ public override StringStatsAggregation Read(ref Utf8JsonReader reader, Type type continue; } + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + if (reader.ValueTextEquals("script")) { reader.Read(); @@ -108,6 +120,12 @@ public override void Write(Utf8JsonWriter writer, StringStatsAggregation value, JsonSerializer.Serialize(writer, value.Field, options); } + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + if (value.Script is not null) { writer.WritePropertyName("script"); @@ -144,6 +162,8 @@ internal StringStatsAggregation() public Dictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + public override string? Name { get; internal set; } public Elastic.Clients.Elasticsearch.Script? Script { get; set; } @@ -162,6 +182,8 @@ public StringStatsAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private bool? ShowDistributionValue { get; set; } @@ -184,6 +206,12 @@ public StringStatsAggregationDescriptor Meta(Func Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + public StringStatsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) { ScriptValue = script; @@ -207,6 +235,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FieldValue, options); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + if (ScriptValue is not null) { writer.WritePropertyName("script"); @@ -241,6 +275,8 @@ public StringStatsAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private bool? ShowDistributionValue { get; set; } @@ -269,6 +305,12 @@ public StringStatsAggregationDescriptor Meta(Func backingDictiona [JsonInclude] [JsonPropertyName("key")] - public string Key { get; init; } + public Elastic.Clients.Elasticsearch.FieldValue Key { get; init; } } internal sealed class StringTermsBucketConverter : JsonConverter @@ -53,7 +53,7 @@ internal sealed class StringTermsBucketConverter : JsonConverter(); // TODO - Optimise this and only create if we need it. long docCount = default; long? docCountError = default; - string key = default; + Elastic.Clients.Elasticsearch.FieldValue key = default; while (reader.Read()) { if (reader.TokenType == JsonTokenType.EndObject) @@ -76,7 +76,7 @@ internal sealed class StringTermsBucketConverter : JsonConverter(ref reader, options); + key = JsonSerializer.Deserialize(ref reader, options); continue; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregation.g.cs index a0059b34aaf..214111598e4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/SumAggregation.g.cs @@ -63,6 +63,18 @@ public override SumAggregation Read(ref Utf8JsonReader reader, Type typeToConver continue; } + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + if (reader.ValueTextEquals("script")) { reader.Read(); @@ -114,6 +126,12 @@ public override void Write(Utf8JsonWriter writer, SumAggregation value, JsonSeri writer.WriteStringValue(value.Format); } + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + if (value.Script is not null) { writer.WritePropertyName("script"); @@ -146,6 +164,8 @@ internal SumAggregation() public Dictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + public override string? Name { get; internal set; } public Elastic.Clients.Elasticsearch.Script? Script { get; set; } @@ -164,6 +184,8 @@ public SumAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } public SumAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) @@ -190,6 +212,12 @@ public SumAggregationDescriptor Meta(Func Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + public SumAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) { ScriptValue = script; @@ -213,6 +241,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + if (ScriptValue is not null) { writer.WritePropertyName("script"); @@ -243,6 +277,8 @@ public SumAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } public SumAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) @@ -275,6 +311,12 @@ public SumAggregationDescriptor Meta(Func, Flue return Self; } + public SumAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + public SumAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) { ScriptValue = script; @@ -298,6 +340,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + if (ScriptValue is not null) { writer.WritePropertyName("script"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.g.cs index f23ebf0a160..20a7d4d7a73 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.g.cs @@ -123,6 +123,18 @@ public override TermsAggregation Read(ref Utf8JsonReader reader, Type typeToConv continue; } + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + if (reader.ValueTextEquals("missing_bucket")) { reader.Read(); @@ -299,6 +311,12 @@ public override void Write(Utf8JsonWriter writer, TermsAggregation value, JsonSe writer.WriteNumberValue(value.MinDocCount.Value); } + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + if (value.MissingBucket.HasValue) { writer.WritePropertyName("missing_bucket"); @@ -391,6 +409,8 @@ internal TermsAggregation() public int? MinDocCount { get; set; } + public FieldValue? Missing { get; set; } + public bool? MissingBucket { get; set; } public Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? MissingOrder { get; set; } @@ -440,6 +460,8 @@ public TermsAggregationDescriptor() : base() private int? MinDocCountValue { get; set; } + private FieldValue? MissingValue { get; set; } + private bool? MissingBucketValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? MissingOrderValue { get; set; } @@ -534,6 +556,12 @@ public TermsAggregationDescriptor MinDocCount(int? minDocCount) return Self; } + public TermsAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + public TermsAggregationDescriptor MissingBucket(bool? missingBucket = true) { MissingBucketValue = missingBucket; @@ -629,6 +657,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(MinDocCountValue.Value); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + if (MissingBucketValue.HasValue) { writer.WritePropertyName("missing_bucket"); @@ -733,6 +767,8 @@ public TermsAggregationDescriptor() : base() private int? MinDocCountValue { get; set; } + private FieldValue? MissingValue { get; set; } + private bool? MissingBucketValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? MissingOrderValue { get; set; } @@ -833,6 +869,12 @@ public TermsAggregationDescriptor MinDocCount(int? minDocCount) return Self; } + public TermsAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + public TermsAggregationDescriptor MissingBucket(bool? missingBucket = true) { MissingBucketValue = missingBucket; @@ -928,6 +970,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(MinDocCountValue.Value); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + if (MissingBucketValue.HasValue) { writer.WritePropertyName("missing_bucket"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregation.g.cs index 1c289305bd3..aa3bf098210 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopHitsAggregation.g.cs @@ -111,6 +111,18 @@ public override TopHitsAggregation Read(ref Utf8JsonReader reader, Type typeToCo continue; } + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + if (reader.ValueTextEquals("script")) { reader.Read(); @@ -270,6 +282,12 @@ public override void Write(Utf8JsonWriter writer, TopHitsAggregation value, Json JsonSerializer.Serialize(writer, value.Highlight, options); } + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + if (value.Script is not null) { writer.WritePropertyName("script"); @@ -352,6 +370,8 @@ internal TopHitsAggregation() public Dictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + public override string? Name { get; internal set; } public Elastic.Clients.Elasticsearch.Script? Script { get; set; } @@ -397,6 +417,8 @@ public TopHitsAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private Dictionary? ScriptFieldsValue { get; set; } @@ -449,12 +471,6 @@ public TopHitsAggregationDescriptor DocvalueFields(Elastic.Clients.El return Self; } - public TopHitsAggregationDescriptor DocvalueFields(Expression> docvalueFields) - { - DocvalueFieldsValue = docvalueFields; - return Self; - } - public TopHitsAggregationDescriptor Explain(bool? explain = true) { ExplainValue = explain; @@ -485,6 +501,12 @@ public TopHitsAggregationDescriptor Meta(Func Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + public TopHitsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) { ScriptValue = script; @@ -521,12 +543,6 @@ public TopHitsAggregationDescriptor StoredFields(Elastic.Clients.Elas return Self; } - public TopHitsAggregationDescriptor StoredFields(Expression> storedFields) - { - StoredFieldsValue = storedFields; - return Self; - } - public TopHitsAggregationDescriptor TrackScores(bool? trackScores = true) { TrackScoresValue = trackScores; @@ -590,6 +606,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(FromValue.Value); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + if (ScriptValue is not null) { writer.WritePropertyName("script"); @@ -674,6 +696,8 @@ public TopHitsAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private Dictionary? ScriptFieldsValue { get; set; } @@ -726,18 +750,6 @@ public TopHitsAggregationDescriptor DocvalueFields(Elastic.Clients.Elasticsearch return Self; } - public TopHitsAggregationDescriptor DocvalueFields(Expression> docvalueFields) - { - DocvalueFieldsValue = docvalueFields; - return Self; - } - - public TopHitsAggregationDescriptor DocvalueFields(Expression> docvalueFields) - { - DocvalueFieldsValue = docvalueFields; - return Self; - } - public TopHitsAggregationDescriptor Explain(bool? explain = true) { ExplainValue = explain; @@ -774,6 +786,12 @@ public TopHitsAggregationDescriptor Meta(Func, return Self; } + public TopHitsAggregationDescriptor Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + public TopHitsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) { ScriptValue = script; @@ -810,18 +828,6 @@ public TopHitsAggregationDescriptor StoredFields(Elastic.Clients.Elasticsearch.F return Self; } - public TopHitsAggregationDescriptor StoredFields(Expression> storedFields) - { - StoredFieldsValue = storedFields; - return Self; - } - - public TopHitsAggregationDescriptor StoredFields(Expression> storedFields) - { - StoredFieldsValue = storedFields; - return Self; - } - public TopHitsAggregationDescriptor TrackScores(bool? trackScores = true) { TrackScoresValue = trackScores; @@ -885,6 +891,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(FromValue.Value); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + if (ScriptValue is not null) { writer.WritePropertyName("script"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetrics.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetrics.g.cs index 6c86a945043..f9ba6e2dc39 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetrics.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetrics.g.cs @@ -28,10 +28,10 @@ public sealed partial class TopMetrics { [JsonInclude] [JsonPropertyName("metrics")] - public Dictionary? Metrics { get; init; } + public Dictionary? Metrics { get; init; } [JsonInclude] [JsonPropertyName("sort")] - public IReadOnlyCollection? Sort { get; init; } + public IReadOnlyCollection? Sort { get; init; } } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsAggregation.g.cs index 3f754d2159c..1c03fa1e4d4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TopMetricsAggregation.g.cs @@ -63,6 +63,18 @@ public override TopMetricsAggregation Read(ref Utf8JsonReader reader, Type typeT continue; } + if (reader.ValueTextEquals("missing")) + { + reader.Read(); + var value = JsonSerializer.Deserialize(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + if (reader.ValueTextEquals("script")) { reader.Read(); @@ -138,6 +150,12 @@ public override void Write(Utf8JsonWriter writer, TopMetricsAggregation value, J JsonSerializer.Serialize(writer, value.Metrics, options); } + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + if (value.Script is not null) { writer.WritePropertyName("script"); @@ -182,6 +200,8 @@ internal TopMetricsAggregation() public IEnumerable? Metrics { get; set; } + public FieldValue? Missing { get; set; } + public override string? Name { get; internal set; } public Elastic.Clients.Elasticsearch.Script? Script { get; set; } @@ -211,6 +231,8 @@ public TopMetricsAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private int? SizeValue { get; set; } @@ -271,6 +293,12 @@ public TopMetricsAggregationDescriptor Meta(Func Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + public TopMetricsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) { ScriptValue = script; @@ -331,6 +359,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, FieldValue, options); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + if (ScriptValue is not null) { writer.WritePropertyName("script"); @@ -379,6 +413,8 @@ public TopMetricsAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private int? SizeValue { get; set; } @@ -445,6 +481,12 @@ public TopMetricsAggregationDescriptor Meta(Func(ref reader, options); + if (value is not null) + { + agg.Missing = value; + } + + continue; + } + if (reader.ValueTextEquals("script")) { reader.Read(); @@ -114,6 +126,12 @@ public override void Write(Utf8JsonWriter writer, ValueCountAggregation value, J writer.WriteStringValue(value.Format); } + if (value.Missing is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, value.Missing, options); + } + if (value.Script is not null) { writer.WritePropertyName("script"); @@ -146,6 +164,8 @@ internal ValueCountAggregation() public Dictionary? Meta { get; set; } + public FieldValue? Missing { get; set; } + public override string? Name { get; internal set; } public Elastic.Clients.Elasticsearch.Script? Script { get; set; } @@ -164,6 +184,8 @@ public ValueCountAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } public ValueCountAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) @@ -190,6 +212,12 @@ public ValueCountAggregationDescriptor Meta(Func Missing(FieldValue? missing) + { + MissingValue = missing; + return Self; + } + public ValueCountAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) { ScriptValue = script; @@ -213,6 +241,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(FormatValue); } + if (MissingValue is not null) + { + writer.WritePropertyName("missing"); + JsonSerializer.Serialize(writer, MissingValue, options); + } + if (ScriptValue is not null) { writer.WritePropertyName("script"); @@ -243,6 +277,8 @@ public ValueCountAggregationDescriptor() : base() private Dictionary? MetaValue { get; set; } + private FieldValue? MissingValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } public ValueCountAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? field) @@ -275,6 +311,12 @@ public ValueCountAggregationDescriptor Meta(Func? Get { get; init; } + public Elastic.Clients.Elasticsearch.InlineGet? Get { get; init; } [JsonInclude] [JsonPropertyName("result")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Aggregations.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Aggregations.g.cs index 63608605033..41561582884 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Aggregations.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Aggregations.g.cs @@ -176,6 +176,8 @@ public enum GapPolicy { [EnumMember(Value = "skip")] Skip, + [EnumMember(Value = "keep_values")] + KeepValues, [EnumMember(Value = "insert_zeros")] InsertZeros } @@ -189,6 +191,8 @@ public override GapPolicy Read(ref Utf8JsonReader reader, Type typeToConvert, Js { case "skip": return GapPolicy.Skip; + case "keep_values": + return GapPolicy.KeepValues; case "insert_zeros": return GapPolicy.InsertZeros; } @@ -204,6 +208,9 @@ public override void Write(Utf8JsonWriter writer, GapPolicy value, JsonSerialize case GapPolicy.Skip: writer.WriteStringValue("skip"); return; + case GapPolicy.KeepValues: + writer.WriteStringValue("keep_values"); + return; case GapPolicy.InsertZeros: writer.WriteStringValue("insert_zeros"); return; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Mapping.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Mapping.g.cs index 417846d460c..557c7911677 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Mapping.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Mapping.g.cs @@ -703,6 +703,55 @@ public override void Write(Utf8JsonWriter writer, RuntimeFieldType value, JsonSe } } + [JsonConverter(typeof(SourceFieldModeConverter))] + public enum SourceFieldMode + { + [EnumMember(Value = "synthetic")] + Synthetic, + [EnumMember(Value = "stored")] + Stored, + [EnumMember(Value = "disabled")] + Disabled + } + + internal sealed class SourceFieldModeConverter : JsonConverter + { + public override SourceFieldMode Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var enumString = reader.GetString(); + switch (enumString) + { + case "synthetic": + return SourceFieldMode.Synthetic; + case "stored": + return SourceFieldMode.Stored; + case "disabled": + return SourceFieldMode.Disabled; + } + + ThrowHelper.ThrowJsonException(); + return default; + } + + public override void Write(Utf8JsonWriter writer, SourceFieldMode value, JsonSerializerOptions options) + { + switch (value) + { + case SourceFieldMode.Synthetic: + writer.WriteStringValue("synthetic"); + return; + case SourceFieldMode.Stored: + writer.WriteStringValue("stored"); + return; + case SourceFieldMode.Disabled: + writer.WriteStringValue("disabled"); + return; + } + + writer.WriteNullValue(); + } + } + [JsonConverter(typeof(TermVectorOptionConverter))] public enum TermVectorOption { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.NoNamespace.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.NoNamespace.g.cs index 18aaaad1592..f4342510954 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.NoNamespace.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.NoNamespace.g.cs @@ -1291,6 +1291,8 @@ public readonly partial struct ScriptLanguage [JsonConverter(typeof(ScriptSortTypeConverter))] public enum ScriptSortType { + [EnumMember(Value = "version")] + Version, [EnumMember(Value = "string")] String, [EnumMember(Value = "number")] @@ -1304,6 +1306,8 @@ public override ScriptSortType Read(ref Utf8JsonReader reader, Type typeToConver var enumString = reader.GetString(); switch (enumString) { + case "version": + return ScriptSortType.Version; case "string": return ScriptSortType.String; case "number": @@ -1318,6 +1322,9 @@ public override void Write(Utf8JsonWriter writer, ScriptSortType value, JsonSeri { switch (value) { + case ScriptSortType.Version: + writer.WriteStringValue("version"); + return; case ScriptSortType.String: writer.WriteStringValue("string"); return; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/FetchProfileBreakdown.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FetchProfileBreakdown.g.cs index 6f5d9bbba04..692239bfba3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/FetchProfileBreakdown.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FetchProfileBreakdown.g.cs @@ -26,6 +26,14 @@ namespace Elastic.Clients.Elasticsearch { public sealed partial class FetchProfileBreakdown { + [JsonInclude] + [JsonPropertyName("load_source")] + public int? LoadSource { get; init; } + + [JsonInclude] + [JsonPropertyName("load_source_count")] + public int? LoadSourceCount { get; init; } + [JsonInclude] [JsonPropertyName("load_stored_fields")] public int? LoadStoredFields { get; init; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSort.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSort.g.cs index 41c038fe0ad..5239cd6b9b3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSort.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/FieldSort.g.cs @@ -30,6 +30,10 @@ public sealed partial class FieldSort [JsonPropertyName("format")] public string? Format { get; init; } + [JsonInclude] + [JsonPropertyName("missing")] + public FieldValue? Missing { get; init; } + [JsonInclude] [JsonPropertyName("mode")] public Elastic.Clients.Elasticsearch.SortMode? Mode { get; init; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/HighlightField.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/HighlightField.g.cs index 4727d18308d..9bc76c6fb51 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/HighlightField.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/HighlightField.g.cs @@ -26,6 +26,10 @@ namespace Elastic.Clients.Elasticsearch { public sealed partial class HighlightField { + [JsonInclude] + [JsonPropertyName("analyzer")] + public Elastic.Clients.Elasticsearch.Analysis.Analyzers? Analyzer { get; set; } + [JsonInclude] [JsonPropertyName("boundary_chars")] public string? BoundaryChars { get; set; } @@ -132,6 +136,8 @@ public HighlightFieldDescriptor() : base() private Action> HighlightQueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Analysis.Analyzers? AnalyzerValue { get; set; } + private string? BoundaryCharsValue { get; set; } private int? BoundaryMaxScanValue { get; set; } @@ -200,6 +206,12 @@ public HighlightFieldDescriptor HighlightQuery(Action Analyzer(Elastic.Clients.Elasticsearch.Analysis.Analyzers? analyzer) + { + AnalyzerValue = analyzer; + return Self; + } + public HighlightFieldDescriptor BoundaryChars(string? boundaryChars) { BoundaryCharsValue = boundaryChars; @@ -260,12 +272,6 @@ public HighlightFieldDescriptor MatchedFields(Elastic.Clients.Elastic return Self; } - public HighlightFieldDescriptor MatchedFields(Expression> matchedFields) - { - MatchedFieldsValue = matchedFields; - return Self; - } - public HighlightFieldDescriptor MaxAnalyzedOffset(int? maxAnalyzedOffset) { MaxAnalyzedOffsetValue = maxAnalyzedOffset; @@ -357,6 +363,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, HighlightQueryValue, options); } + if (AnalyzerValue is not null) + { + writer.WritePropertyName("analyzer"); + JsonSerializer.Serialize(writer, AnalyzerValue, options); + } + if (!string.IsNullOrEmpty(BoundaryCharsValue)) { writer.WritePropertyName("boundary_chars"); @@ -506,6 +518,8 @@ public HighlightFieldDescriptor() : base() private Action HighlightQueryDescriptorAction { get; set; } + private Elastic.Clients.Elasticsearch.Analysis.Analyzers? AnalyzerValue { get; set; } + private string? BoundaryCharsValue { get; set; } private int? BoundaryMaxScanValue { get; set; } @@ -574,6 +588,12 @@ public HighlightFieldDescriptor HighlightQuery(Action(Expression> matchedFields) - { - MatchedFieldsValue = matchedFields; - return Self; - } - - public HighlightFieldDescriptor MatchedFields(Expression> matchedFields) - { - MatchedFieldsValue = matchedFields; - return Self; - } - public HighlightFieldDescriptor MaxAnalyzedOffset(int? maxAnalyzedOffset) { MaxAnalyzedOffsetValue = maxAnalyzedOffset; @@ -737,6 +745,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, HighlightQueryValue, options); } + if (AnalyzerValue is not null) + { + writer.WritePropertyName("analyzer"); + JsonSerializer.Serialize(writer, AnalyzerValue, options); + } + if (!string.IsNullOrEmpty(BoundaryCharsValue)) { writer.WritePropertyName("boundary_chars"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Hit.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Hit.g.cs index d413fc63ca5..6c1bc0210f7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Hit.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Hit.g.cs @@ -101,6 +101,6 @@ public sealed partial class Hit [JsonInclude] [JsonPropertyName("sort")] - public IReadOnlyCollection? Sort { get; init; } + public IReadOnlyCollection? Sort { get; init; } } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSegmentSort.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSegmentSort.g.cs index e9a8f18827f..8d73280c7a2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSegmentSort.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexSegmentSort.g.cs @@ -64,12 +64,6 @@ public IndexSegmentSortDescriptor Field(Elastic.Clients.Elasticsearch return Self; } - public IndexSegmentSortDescriptor Field(Expression> field) - { - FieldValue = field; - return Self; - } - public IndexSegmentSortDescriptor Missing(IEnumerable? missing) { MissingValue = missing; @@ -140,18 +134,6 @@ public IndexSegmentSortDescriptor Field(Elastic.Clients.Elasticsearch.Fields? fi return Self; } - public IndexSegmentSortDescriptor Field(Expression> field) - { - FieldValue = field; - return Self; - } - - public IndexSegmentSortDescriptor Field(Expression> field) - { - FieldValue = field; - return Self; - } - public IndexSegmentSortDescriptor Missing(IEnumerable? missing) { MissingValue = missing; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexVersioning.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexVersioning.g.cs index c53f471cdd3..8808e139bc5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexVersioning.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexVersioning.g.cs @@ -29,6 +29,10 @@ public sealed partial class IndexVersioning [JsonInclude] [JsonPropertyName("created")] public string? Created { get; set; } + + [JsonInclude] + [JsonPropertyName("created_string")] + public string? CreatedString { get; set; } } public sealed partial class IndexVersioningDescriptor : SerializableDescriptorBase @@ -40,12 +44,20 @@ public IndexVersioningDescriptor() : base() private string? CreatedValue { get; set; } + private string? CreatedStringValue { get; set; } + public IndexVersioningDescriptor Created(string? created) { CreatedValue = created; return Self; } + public IndexVersioningDescriptor CreatedString(string? createdString) + { + CreatedStringValue = createdString; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); @@ -55,6 +67,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, CreatedValue, options); } + if (!string.IsNullOrEmpty(CreatedStringValue)) + { + writer.WritePropertyName("created_string"); + writer.WriteStringValue(CreatedStringValue); + } + writer.WriteEndObject(); } } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RolloverConditions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RolloverConditions.g.cs index 407edd7f0b6..90eebceaac9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RolloverConditions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RolloverConditions.g.cs @@ -38,6 +38,10 @@ public sealed partial class RolloverConditions [JsonPropertyName("max_docs")] public long? MaxDocs { get; set; } + [JsonInclude] + [JsonPropertyName("max_primary_shard_docs")] + public long? MaxPrimaryShardDocs { get; set; } + [JsonInclude] [JsonPropertyName("max_primary_shard_size")] public Elastic.Clients.Elasticsearch.ByteSize? MaxPrimaryShardSize { get; set; } @@ -53,6 +57,18 @@ public sealed partial class RolloverConditions [JsonInclude] [JsonPropertyName("max_size_bytes")] public Elastic.Clients.Elasticsearch.ByteSize? MaxSizeBytes { get; set; } + + [JsonInclude] + [JsonPropertyName("min_age")] + public Elastic.Clients.Elasticsearch.Duration? MinAge { get; set; } + + [JsonInclude] + [JsonPropertyName("min_docs")] + public long? MinDocs { get; set; } + + [JsonInclude] + [JsonPropertyName("min_primary_shard_docs")] + public long? MinPrimaryShardDocs { get; set; } } public sealed partial class RolloverConditionsDescriptor : SerializableDescriptorBase @@ -68,6 +84,8 @@ public RolloverConditionsDescriptor() : base() private long? MaxDocsValue { get; set; } + private long? MaxPrimaryShardDocsValue { get; set; } + private Elastic.Clients.Elasticsearch.ByteSize? MaxPrimaryShardSizeValue { get; set; } private Elastic.Clients.Elasticsearch.ByteSize? MaxPrimaryShardSizeBytesValue { get; set; } @@ -76,6 +94,12 @@ public RolloverConditionsDescriptor() : base() private Elastic.Clients.Elasticsearch.ByteSize? MaxSizeBytesValue { get; set; } + private Elastic.Clients.Elasticsearch.Duration? MinAgeValue { get; set; } + + private long? MinDocsValue { get; set; } + + private long? MinPrimaryShardDocsValue { get; set; } + public RolloverConditionsDescriptor MaxAge(Elastic.Clients.Elasticsearch.Duration? maxAge) { MaxAgeValue = maxAge; @@ -94,6 +118,12 @@ public RolloverConditionsDescriptor MaxDocs(long? maxDocs) return Self; } + public RolloverConditionsDescriptor MaxPrimaryShardDocs(long? maxPrimaryShardDocs) + { + MaxPrimaryShardDocsValue = maxPrimaryShardDocs; + return Self; + } + public RolloverConditionsDescriptor MaxPrimaryShardSize(Elastic.Clients.Elasticsearch.ByteSize? maxPrimaryShardSize) { MaxPrimaryShardSizeValue = maxPrimaryShardSize; @@ -118,6 +148,24 @@ public RolloverConditionsDescriptor MaxSizeBytes(Elastic.Clients.Elasticsearch.B return Self; } + public RolloverConditionsDescriptor MinAge(Elastic.Clients.Elasticsearch.Duration? minAge) + { + MinAgeValue = minAge; + return Self; + } + + public RolloverConditionsDescriptor MinDocs(long? minDocs) + { + MinDocsValue = minDocs; + return Self; + } + + public RolloverConditionsDescriptor MinPrimaryShardDocs(long? minPrimaryShardDocs) + { + MinPrimaryShardDocsValue = minPrimaryShardDocs; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); @@ -139,6 +187,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(MaxDocsValue.Value); } + if (MaxPrimaryShardDocsValue.HasValue) + { + writer.WritePropertyName("max_primary_shard_docs"); + writer.WriteNumberValue(MaxPrimaryShardDocsValue.Value); + } + if (MaxPrimaryShardSizeValue is not null) { writer.WritePropertyName("max_primary_shard_size"); @@ -163,6 +217,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, MaxSizeBytesValue, options); } + if (MinAgeValue is not null) + { + writer.WritePropertyName("min_age"); + JsonSerializer.Serialize(writer, MinAgeValue, options); + } + + if (MinDocsValue.HasValue) + { + writer.WritePropertyName("min_docs"); + writer.WriteNumberValue(MinDocsValue.Value); + } + + if (MinPrimaryShardDocsValue.HasValue) + { + writer.WritePropertyName("min_primary_shard_docs"); + writer.WriteNumberValue(MinPrimaryShardDocsValue.Value); + } + writer.WriteEndObject(); } } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityBm25.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityBm25.g.cs index b3fbdad2454..2ae26f7a2c7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityBm25.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/SettingsSimilarityBm25.g.cs @@ -28,7 +28,7 @@ public sealed partial class SettingsSimilarityBm25 { [JsonInclude] [JsonPropertyName("b")] - public int b { get; set; } + public double b { get; set; } [JsonInclude] [JsonPropertyName("discount_overlaps")] @@ -50,13 +50,13 @@ public SettingsSimilarityBm25Descriptor() : base() { } - private int bValue { get; set; } + private double bValue { get; set; } private bool DiscountOverlapsValue { get; set; } private double K1Value { get; set; } - public SettingsSimilarityBm25Descriptor b(int b) + public SettingsSimilarityBm25Descriptor b(double b) { bValue = b; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/InnerHits.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/InnerHits.g.cs index 89b9e895a0f..d7998cb7193 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/InnerHits.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/InnerHits.g.cs @@ -247,12 +247,6 @@ public InnerHitsDescriptor Fields(Elastic.Clients.Elasticsearch.Field return Self; } - public InnerHitsDescriptor Fields(Expression> fields) - { - FieldsValue = fields; - return Self; - } - public InnerHitsDescriptor From(int? from) { FromValue = from; @@ -301,12 +295,6 @@ public InnerHitsDescriptor StoredField(Elastic.Clients.Elasticsearch. return Self; } - public InnerHitsDescriptor StoredField(Expression> storedField) - { - StoredFieldValue = storedField; - return Self; - } - public InnerHitsDescriptor TrackScores(bool? trackScores = true) { TrackScoresValue = trackScores; @@ -622,18 +610,6 @@ public InnerHitsDescriptor Fields(Elastic.Clients.Elasticsearch.Fields? fields) return Self; } - public InnerHitsDescriptor Fields(Expression> fields) - { - FieldsValue = fields; - return Self; - } - - public InnerHitsDescriptor Fields(Expression> fields) - { - FieldsValue = fields; - return Self; - } - public InnerHitsDescriptor From(int? from) { FromValue = from; @@ -682,18 +658,6 @@ public InnerHitsDescriptor StoredField(Elastic.Clients.Elasticsearch.Fields? sto return Self; } - public InnerHitsDescriptor StoredField(Expression> storedField) - { - StoredFieldValue = storedField; - return Self; - } - - public InnerHitsDescriptor StoredField(Expression> storedField) - { - StoredFieldValue = storedField; - return Self; - } - public InnerHitsDescriptor TrackScores(bool? trackScores = true) { TrackScoresValue = trackScores; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/AggregateMetricDoubleProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/AggregateMetricDoubleProperty.g.cs index b0cf4129f28..fe2963d2b23 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/AggregateMetricDoubleProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/AggregateMetricDoubleProperty.g.cs @@ -58,6 +58,10 @@ public sealed partial class AggregateMetricDoubleProperty : IProperty [JsonPropertyName("properties")] public Elastic.Clients.Elasticsearch.Mapping.Properties? Properties { get; set; } + [JsonInclude] + [JsonPropertyName("time_series_metric")] + public Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } + [JsonInclude] [JsonPropertyName("type")] public string Type => "aggregate_metric_double"; @@ -86,6 +90,8 @@ public AggregateMetricDoublePropertyDescriptor() : base() private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + public AggregateMetricDoublePropertyDescriptor DefaultMetric(string defaultMetric) { DefaultMetricValue = defaultMetric; @@ -162,6 +168,12 @@ public AggregateMetricDoublePropertyDescriptor Properties(Action TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) + { + TimeSeriesMetricValue = timeSeriesMetric; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); @@ -205,13 +217,19 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, PropertiesValue, options); } + if (TimeSeriesMetricValue is not null) + { + writer.WritePropertyName("time_series_metric"); + JsonSerializer.Serialize(writer, TimeSeriesMetricValue, options); + } + writer.WritePropertyName("type"); writer.WriteStringValue("aggregate_metric_double"); writer.WriteEndObject(); } AggregateMetricDoubleProperty IBuildableDescriptor.Build() => new() - { DefaultMetric = DefaultMetricValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, Metrics = MetricsValue, Properties = PropertiesValue }; + { DefaultMetric = DefaultMetricValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, Metrics = MetricsValue, Properties = PropertiesValue, TimeSeriesMetric = TimeSeriesMetricValue }; } public sealed partial class AggregateMetricDoublePropertyDescriptor : SerializableDescriptorBase, IBuildableDescriptor @@ -237,6 +255,8 @@ public AggregateMetricDoublePropertyDescriptor() : base() private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + public AggregateMetricDoublePropertyDescriptor DefaultMetric(string defaultMetric) { DefaultMetricValue = defaultMetric; @@ -313,6 +333,12 @@ public AggregateMetricDoublePropertyDescriptor Properties(Action.Build() => new() - { DefaultMetric = DefaultMetricValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, Metrics = MetricsValue, Properties = PropertiesValue }; + { DefaultMetric = DefaultMetricValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, Metrics = MetricsValue, Properties = PropertiesValue, TimeSeriesMetric = TimeSeriesMetricValue }; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BinaryProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BinaryProperty.g.cs index 6329f8c1b48..bb1920df2f6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BinaryProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BinaryProperty.g.cs @@ -104,12 +104,6 @@ public BinaryPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch. return Self; } - public BinaryPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public BinaryPropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; @@ -297,18 +291,6 @@ public BinaryPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? cop return Self; } - public BinaryPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - - public BinaryPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public BinaryPropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BooleanProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BooleanProperty.g.cs index e484587f6ad..304feb2835d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BooleanProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/BooleanProperty.g.cs @@ -138,12 +138,6 @@ public BooleanPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch return Self; } - public BooleanPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public BooleanPropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; @@ -443,18 +437,6 @@ public BooleanPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? co return Self; } - public BooleanPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - - public BooleanPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public BooleanPropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ByteNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ByteNumberProperty.g.cs index a574217d6aa..118d45ebf2c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ByteNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ByteNumberProperty.g.cs @@ -26,6 +26,10 @@ namespace Elastic.Clients.Elasticsearch.Mapping { public sealed partial class ByteNumberProperty : IProperty { + [JsonInclude] + [JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude] [JsonPropertyName("coerce")] public bool? Coerce { get; set; } @@ -90,6 +94,10 @@ public sealed partial class ByteNumberProperty : IProperty [JsonPropertyName("store")] public bool? Store { get; set; } + [JsonInclude] + [JsonPropertyName("time_series_dimension")] + public bool? TimeSeriesDimension { get; set; } + [JsonInclude] [JsonPropertyName("time_series_metric")] public Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } @@ -106,6 +114,8 @@ public ByteNumberPropertyDescriptor() : base() { } + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } private Elastic.Clients.Elasticsearch.Fields? CopyToValue { get; set; } @@ -138,21 +148,23 @@ public ByteNumberPropertyDescriptor() : base() private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } - public ByteNumberPropertyDescriptor Coerce(bool? coerce = true) + public ByteNumberPropertyDescriptor Boost(double? boost) { - CoerceValue = coerce; + BoostValue = boost; return Self; } - public ByteNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) + public ByteNumberPropertyDescriptor Coerce(bool? coerce = true) { - CopyToValue = copyTo; + CoerceValue = coerce; return Self; } - public ByteNumberPropertyDescriptor CopyTo(Expression> copyTo) + public ByteNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) { CopyToValue = copyTo; return Self; @@ -270,6 +282,12 @@ public ByteNumberPropertyDescriptor Store(bool? store = true) return Self; } + public ByteNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + public ByteNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; @@ -279,6 +297,12 @@ public ByteNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients. protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + if (CoerceValue.HasValue) { writer.WritePropertyName("coerce"); @@ -375,6 +399,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(StoreValue.Value); } + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + if (TimeSeriesMetricValue is not null) { writer.WritePropertyName("time_series_metric"); @@ -387,7 +417,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } ByteNumberProperty IBuildableDescriptor.Build() => new() - { Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesMetric = TimeSeriesMetricValue }; + { Boost = BoostValue, Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesDimension = TimeSeriesDimensionValue, TimeSeriesMetric = TimeSeriesMetricValue }; } public sealed partial class ByteNumberPropertyDescriptor : SerializableDescriptorBase, IBuildableDescriptor @@ -397,6 +427,8 @@ public ByteNumberPropertyDescriptor() : base() { } + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } private Elastic.Clients.Elasticsearch.Fields? CopyToValue { get; set; } @@ -429,27 +461,23 @@ public ByteNumberPropertyDescriptor() : base() private bool? StoreValue { get; set; } - private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } - public ByteNumberPropertyDescriptor Coerce(bool? coerce = true) - { - CoerceValue = coerce; - return Self; - } + private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } - public ByteNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) + public ByteNumberPropertyDescriptor Boost(double? boost) { - CopyToValue = copyTo; + BoostValue = boost; return Self; } - public ByteNumberPropertyDescriptor CopyTo(Expression> copyTo) + public ByteNumberPropertyDescriptor Coerce(bool? coerce = true) { - CopyToValue = copyTo; + CoerceValue = coerce; return Self; } - public ByteNumberPropertyDescriptor CopyTo(Expression> copyTo) + public ByteNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) { CopyToValue = copyTo; return Self; @@ -567,6 +595,12 @@ public ByteNumberPropertyDescriptor Store(bool? store = true) return Self; } + public ByteNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + public ByteNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; @@ -576,6 +610,12 @@ public ByteNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsear protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + if (CoerceValue.HasValue) { writer.WritePropertyName("coerce"); @@ -672,6 +712,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(StoreValue.Value); } + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + if (TimeSeriesMetricValue is not null) { writer.WritePropertyName("time_series_metric"); @@ -684,6 +730,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } ByteNumberProperty IBuildableDescriptor.Build() => new() - { Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesMetric = TimeSeriesMetricValue }; + { Boost = BoostValue, Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesDimension = TimeSeriesDimensionValue, TimeSeriesMetric = TimeSeriesMetricValue }; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CompletionProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CompletionProperty.g.cs index 09a4714740d..8587ed649ac 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CompletionProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/CompletionProperty.g.cs @@ -188,12 +188,6 @@ public CompletionPropertyDescriptor CopyTo(Elastic.Clients.Elasticsea return Self; } - public CompletionPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public CompletionPropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; @@ -526,18 +520,6 @@ public CompletionPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? return Self; } - public CompletionPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - - public CompletionPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public CompletionPropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateNanosProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateNanosProperty.g.cs index c68b5760b55..c0ae5b3ba73 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateNanosProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateNanosProperty.g.cs @@ -146,12 +146,6 @@ public DateNanosPropertyDescriptor CopyTo(Elastic.Clients.Elasticsear return Self; } - public DateNanosPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public DateNanosPropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; @@ -423,18 +417,6 @@ public DateNanosPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? return Self; } - public DateNanosPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - - public DateNanosPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public DateNanosPropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateProperty.g.cs index 5418c81d5b8..eb9df9a3d82 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateProperty.g.cs @@ -162,12 +162,6 @@ public DatePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fi return Self; } - public DatePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public DatePropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; @@ -523,18 +517,6 @@ public DatePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyT return Self; } - public DatePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - - public DatePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public DatePropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateRangeProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateRangeProperty.g.cs index 9ad3695c21c..267d1ae0a9b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateRangeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DateRangeProperty.g.cs @@ -140,12 +140,6 @@ public DateRangePropertyDescriptor CopyTo(Elastic.Clients.Elasticsear return Self; } - public DateRangePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public DateRangePropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; @@ -389,18 +383,6 @@ public DateRangePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? return Self; } - public DateRangePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - - public DateRangePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public DateRangePropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleNumberProperty.g.cs index 139efa5287e..42d39058564 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleNumberProperty.g.cs @@ -26,6 +26,10 @@ namespace Elastic.Clients.Elasticsearch.Mapping { public sealed partial class DoubleNumberProperty : IProperty { + [JsonInclude] + [JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude] [JsonPropertyName("coerce")] public bool? Coerce { get; set; } @@ -90,6 +94,10 @@ public sealed partial class DoubleNumberProperty : IProperty [JsonPropertyName("store")] public bool? Store { get; set; } + [JsonInclude] + [JsonPropertyName("time_series_dimension")] + public bool? TimeSeriesDimension { get; set; } + [JsonInclude] [JsonPropertyName("time_series_metric")] public Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } @@ -106,6 +114,8 @@ public DoubleNumberPropertyDescriptor() : base() { } + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } private Elastic.Clients.Elasticsearch.Fields? CopyToValue { get; set; } @@ -138,21 +148,23 @@ public DoubleNumberPropertyDescriptor() : base() private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } - public DoubleNumberPropertyDescriptor Coerce(bool? coerce = true) + public DoubleNumberPropertyDescriptor Boost(double? boost) { - CoerceValue = coerce; + BoostValue = boost; return Self; } - public DoubleNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) + public DoubleNumberPropertyDescriptor Coerce(bool? coerce = true) { - CopyToValue = copyTo; + CoerceValue = coerce; return Self; } - public DoubleNumberPropertyDescriptor CopyTo(Expression> copyTo) + public DoubleNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) { CopyToValue = copyTo; return Self; @@ -270,6 +282,12 @@ public DoubleNumberPropertyDescriptor Store(bool? store = true) return Self; } + public DoubleNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + public DoubleNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; @@ -279,6 +297,12 @@ public DoubleNumberPropertyDescriptor TimeSeriesMetric(Elastic.Client protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + if (CoerceValue.HasValue) { writer.WritePropertyName("coerce"); @@ -375,6 +399,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(StoreValue.Value); } + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + if (TimeSeriesMetricValue is not null) { writer.WritePropertyName("time_series_metric"); @@ -387,7 +417,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } DoubleNumberProperty IBuildableDescriptor.Build() => new() - { Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesMetric = TimeSeriesMetricValue }; + { Boost = BoostValue, Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesDimension = TimeSeriesDimensionValue, TimeSeriesMetric = TimeSeriesMetricValue }; } public sealed partial class DoubleNumberPropertyDescriptor : SerializableDescriptorBase, IBuildableDescriptor @@ -397,6 +427,8 @@ public DoubleNumberPropertyDescriptor() : base() { } + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } private Elastic.Clients.Elasticsearch.Fields? CopyToValue { get; set; } @@ -429,27 +461,23 @@ public DoubleNumberPropertyDescriptor() : base() private bool? StoreValue { get; set; } - private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } - public DoubleNumberPropertyDescriptor Coerce(bool? coerce = true) - { - CoerceValue = coerce; - return Self; - } + private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } - public DoubleNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) + public DoubleNumberPropertyDescriptor Boost(double? boost) { - CopyToValue = copyTo; + BoostValue = boost; return Self; } - public DoubleNumberPropertyDescriptor CopyTo(Expression> copyTo) + public DoubleNumberPropertyDescriptor Coerce(bool? coerce = true) { - CopyToValue = copyTo; + CoerceValue = coerce; return Self; } - public DoubleNumberPropertyDescriptor CopyTo(Expression> copyTo) + public DoubleNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) { CopyToValue = copyTo; return Self; @@ -567,6 +595,12 @@ public DoubleNumberPropertyDescriptor Store(bool? store = true) return Self; } + public DoubleNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + public DoubleNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; @@ -576,6 +610,12 @@ public DoubleNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticse protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + if (CoerceValue.HasValue) { writer.WritePropertyName("coerce"); @@ -672,6 +712,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(StoreValue.Value); } + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + if (TimeSeriesMetricValue is not null) { writer.WritePropertyName("time_series_metric"); @@ -684,6 +730,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } DoubleNumberProperty IBuildableDescriptor.Build() => new() - { Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesMetric = TimeSeriesMetricValue }; + { Boost = BoostValue, Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesDimension = TimeSeriesDimensionValue, TimeSeriesMetric = TimeSeriesMetricValue }; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleRangeProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleRangeProperty.g.cs index 57777084caf..0ec32ea6b31 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleRangeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DoubleRangeProperty.g.cs @@ -134,12 +134,6 @@ public DoubleRangePropertyDescriptor CopyTo(Elastic.Clients.Elasticse return Self; } - public DoubleRangePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public DoubleRangePropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; @@ -369,18 +363,6 @@ public DoubleRangePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields return Self; } - public DoubleRangePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - - public DoubleRangePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public DoubleRangePropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicProperty.g.cs index 2e958ecfef0..00b9eb99e66 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DynamicProperty.g.cs @@ -108,7 +108,7 @@ public sealed partial class DynamicProperty : IProperty [JsonInclude] [JsonPropertyName("null_value")] - public object? NullValue { get; set; } + public Elastic.Clients.Elasticsearch.FieldValue? NullValue { get; set; } [JsonInclude] [JsonPropertyName("on_script_error")] @@ -210,7 +210,7 @@ public DynamicPropertyDescriptor() : base() private bool? NormsValue { get; set; } - private object? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? NullValueValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.OnScriptError? OnScriptErrorValue { get; set; } @@ -258,12 +258,6 @@ public DynamicPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch return Self; } - public DynamicPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public DynamicPropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; @@ -392,7 +386,7 @@ public DynamicPropertyDescriptor Norms(bool? norms = true) return Self; } - public DynamicPropertyDescriptor NullValue(object? nullValue) + public DynamicPropertyDescriptor NullValue(Elastic.Clients.Elasticsearch.FieldValue? nullValue) { NullValueValue = nullValue; return Self; @@ -767,7 +761,7 @@ public DynamicPropertyDescriptor() : base() private bool? NormsValue { get; set; } - private object? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue? NullValueValue { get; set; } private Elastic.Clients.Elasticsearch.Mapping.OnScriptError? OnScriptErrorValue { get; set; } @@ -815,18 +809,6 @@ public DynamicPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? co return Self; } - public DynamicPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - - public DynamicPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public DynamicPropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; @@ -955,7 +937,7 @@ public DynamicPropertyDescriptor Norms(bool? norms = true) return Self; } - public DynamicPropertyDescriptor NullValue(object? nullValue) + public DynamicPropertyDescriptor NullValue(Elastic.Clients.Elasticsearch.FieldValue? nullValue) { NullValueValue = nullValue; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatNumberProperty.g.cs index 8fbd65dfdae..ff9929bb78d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatNumberProperty.g.cs @@ -26,6 +26,10 @@ namespace Elastic.Clients.Elasticsearch.Mapping { public sealed partial class FloatNumberProperty : IProperty { + [JsonInclude] + [JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude] [JsonPropertyName("coerce")] public bool? Coerce { get; set; } @@ -90,6 +94,10 @@ public sealed partial class FloatNumberProperty : IProperty [JsonPropertyName("store")] public bool? Store { get; set; } + [JsonInclude] + [JsonPropertyName("time_series_dimension")] + public bool? TimeSeriesDimension { get; set; } + [JsonInclude] [JsonPropertyName("time_series_metric")] public Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } @@ -106,6 +114,8 @@ public FloatNumberPropertyDescriptor() : base() { } + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } private Elastic.Clients.Elasticsearch.Fields? CopyToValue { get; set; } @@ -138,21 +148,23 @@ public FloatNumberPropertyDescriptor() : base() private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } - public FloatNumberPropertyDescriptor Coerce(bool? coerce = true) + public FloatNumberPropertyDescriptor Boost(double? boost) { - CoerceValue = coerce; + BoostValue = boost; return Self; } - public FloatNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) + public FloatNumberPropertyDescriptor Coerce(bool? coerce = true) { - CopyToValue = copyTo; + CoerceValue = coerce; return Self; } - public FloatNumberPropertyDescriptor CopyTo(Expression> copyTo) + public FloatNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) { CopyToValue = copyTo; return Self; @@ -270,6 +282,12 @@ public FloatNumberPropertyDescriptor Store(bool? store = true) return Self; } + public FloatNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + public FloatNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; @@ -279,6 +297,12 @@ public FloatNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + if (CoerceValue.HasValue) { writer.WritePropertyName("coerce"); @@ -375,6 +399,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(StoreValue.Value); } + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + if (TimeSeriesMetricValue is not null) { writer.WritePropertyName("time_series_metric"); @@ -387,7 +417,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } FloatNumberProperty IBuildableDescriptor.Build() => new() - { Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesMetric = TimeSeriesMetricValue }; + { Boost = BoostValue, Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesDimension = TimeSeriesDimensionValue, TimeSeriesMetric = TimeSeriesMetricValue }; } public sealed partial class FloatNumberPropertyDescriptor : SerializableDescriptorBase, IBuildableDescriptor @@ -397,6 +427,8 @@ public FloatNumberPropertyDescriptor() : base() { } + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } private Elastic.Clients.Elasticsearch.Fields? CopyToValue { get; set; } @@ -429,27 +461,23 @@ public FloatNumberPropertyDescriptor() : base() private bool? StoreValue { get; set; } - private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } - public FloatNumberPropertyDescriptor Coerce(bool? coerce = true) - { - CoerceValue = coerce; - return Self; - } + private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } - public FloatNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) + public FloatNumberPropertyDescriptor Boost(double? boost) { - CopyToValue = copyTo; + BoostValue = boost; return Self; } - public FloatNumberPropertyDescriptor CopyTo(Expression> copyTo) + public FloatNumberPropertyDescriptor Coerce(bool? coerce = true) { - CopyToValue = copyTo; + CoerceValue = coerce; return Self; } - public FloatNumberPropertyDescriptor CopyTo(Expression> copyTo) + public FloatNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) { CopyToValue = copyTo; return Self; @@ -567,6 +595,12 @@ public FloatNumberPropertyDescriptor Store(bool? store = true) return Self; } + public FloatNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + public FloatNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; @@ -576,6 +610,12 @@ public FloatNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsea protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + if (CoerceValue.HasValue) { writer.WritePropertyName("coerce"); @@ -672,6 +712,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(StoreValue.Value); } + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + if (TimeSeriesMetricValue is not null) { writer.WritePropertyName("time_series_metric"); @@ -684,6 +730,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } FloatNumberProperty IBuildableDescriptor.Build() => new() - { Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesMetric = TimeSeriesMetricValue }; + { Boost = BoostValue, Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesDimension = TimeSeriesDimensionValue, TimeSeriesMetric = TimeSeriesMetricValue }; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatRangeProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatRangeProperty.g.cs index 3880e2a305e..f340723d0a7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatRangeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/FloatRangeProperty.g.cs @@ -134,12 +134,6 @@ public FloatRangePropertyDescriptor CopyTo(Elastic.Clients.Elasticsea return Self; } - public FloatRangePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public FloatRangePropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; @@ -369,18 +363,6 @@ public FloatRangePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? return Self; } - public FloatRangePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - - public FloatRangePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public FloatRangePropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoPointProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoPointProperty.g.cs index f1d44f69777..9398e887e33 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoPointProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoPointProperty.g.cs @@ -122,12 +122,6 @@ public GeoPointPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearc return Self; } - public GeoPointPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public GeoPointPropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; @@ -357,18 +351,6 @@ public GeoPointPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? c return Self; } - public GeoPointPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - - public GeoPointPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public GeoPointPropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoShapeProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoShapeProperty.g.cs index 862f9b72564..5aea635574c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoShapeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/GeoShapeProperty.g.cs @@ -140,12 +140,6 @@ public GeoShapePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearc return Self; } - public GeoShapePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public GeoShapePropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; @@ -403,18 +397,6 @@ public GeoShapePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? c return Self; } - public GeoShapePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - - public GeoShapePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public GeoShapePropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HalfFloatNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HalfFloatNumberProperty.g.cs index a36ba58d188..5e4d651175d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HalfFloatNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/HalfFloatNumberProperty.g.cs @@ -26,6 +26,10 @@ namespace Elastic.Clients.Elasticsearch.Mapping { public sealed partial class HalfFloatNumberProperty : IProperty { + [JsonInclude] + [JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude] [JsonPropertyName("coerce")] public bool? Coerce { get; set; } @@ -90,6 +94,10 @@ public sealed partial class HalfFloatNumberProperty : IProperty [JsonPropertyName("store")] public bool? Store { get; set; } + [JsonInclude] + [JsonPropertyName("time_series_dimension")] + public bool? TimeSeriesDimension { get; set; } + [JsonInclude] [JsonPropertyName("time_series_metric")] public Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } @@ -106,6 +114,8 @@ public HalfFloatNumberPropertyDescriptor() : base() { } + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } private Elastic.Clients.Elasticsearch.Fields? CopyToValue { get; set; } @@ -138,21 +148,23 @@ public HalfFloatNumberPropertyDescriptor() : base() private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } - public HalfFloatNumberPropertyDescriptor Coerce(bool? coerce = true) + public HalfFloatNumberPropertyDescriptor Boost(double? boost) { - CoerceValue = coerce; + BoostValue = boost; return Self; } - public HalfFloatNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) + public HalfFloatNumberPropertyDescriptor Coerce(bool? coerce = true) { - CopyToValue = copyTo; + CoerceValue = coerce; return Self; } - public HalfFloatNumberPropertyDescriptor CopyTo(Expression> copyTo) + public HalfFloatNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) { CopyToValue = copyTo; return Self; @@ -270,6 +282,12 @@ public HalfFloatNumberPropertyDescriptor Store(bool? store = true) return Self; } + public HalfFloatNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + public HalfFloatNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; @@ -279,6 +297,12 @@ public HalfFloatNumberPropertyDescriptor TimeSeriesMetric(Elastic.Cli protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + if (CoerceValue.HasValue) { writer.WritePropertyName("coerce"); @@ -375,6 +399,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(StoreValue.Value); } + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + if (TimeSeriesMetricValue is not null) { writer.WritePropertyName("time_series_metric"); @@ -387,7 +417,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } HalfFloatNumberProperty IBuildableDescriptor.Build() => new() - { Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesMetric = TimeSeriesMetricValue }; + { Boost = BoostValue, Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesDimension = TimeSeriesDimensionValue, TimeSeriesMetric = TimeSeriesMetricValue }; } public sealed partial class HalfFloatNumberPropertyDescriptor : SerializableDescriptorBase, IBuildableDescriptor @@ -397,6 +427,8 @@ public HalfFloatNumberPropertyDescriptor() : base() { } + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } private Elastic.Clients.Elasticsearch.Fields? CopyToValue { get; set; } @@ -429,27 +461,23 @@ public HalfFloatNumberPropertyDescriptor() : base() private bool? StoreValue { get; set; } - private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } - public HalfFloatNumberPropertyDescriptor Coerce(bool? coerce = true) - { - CoerceValue = coerce; - return Self; - } + private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } - public HalfFloatNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) + public HalfFloatNumberPropertyDescriptor Boost(double? boost) { - CopyToValue = copyTo; + BoostValue = boost; return Self; } - public HalfFloatNumberPropertyDescriptor CopyTo(Expression> copyTo) + public HalfFloatNumberPropertyDescriptor Coerce(bool? coerce = true) { - CopyToValue = copyTo; + CoerceValue = coerce; return Self; } - public HalfFloatNumberPropertyDescriptor CopyTo(Expression> copyTo) + public HalfFloatNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) { CopyToValue = copyTo; return Self; @@ -567,6 +595,12 @@ public HalfFloatNumberPropertyDescriptor Store(bool? store = true) return Self; } + public HalfFloatNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + public HalfFloatNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; @@ -576,6 +610,12 @@ public HalfFloatNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasti protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + if (CoerceValue.HasValue) { writer.WritePropertyName("coerce"); @@ -672,6 +712,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(StoreValue.Value); } + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + if (TimeSeriesMetricValue is not null) { writer.WritePropertyName("time_series_metric"); @@ -684,6 +730,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } HalfFloatNumberProperty IBuildableDescriptor.Build() => new() - { Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesMetric = TimeSeriesMetricValue }; + { Boost = BoostValue, Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesDimension = TimeSeriesDimensionValue, TimeSeriesMetric = TimeSeriesMetricValue }; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerNumberProperty.g.cs index 5466e62e1bd..c537e28ec75 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerNumberProperty.g.cs @@ -26,6 +26,10 @@ namespace Elastic.Clients.Elasticsearch.Mapping { public sealed partial class IntegerNumberProperty : IProperty { + [JsonInclude] + [JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude] [JsonPropertyName("coerce")] public bool? Coerce { get; set; } @@ -90,6 +94,10 @@ public sealed partial class IntegerNumberProperty : IProperty [JsonPropertyName("store")] public bool? Store { get; set; } + [JsonInclude] + [JsonPropertyName("time_series_dimension")] + public bool? TimeSeriesDimension { get; set; } + [JsonInclude] [JsonPropertyName("time_series_metric")] public Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } @@ -106,6 +114,8 @@ public IntegerNumberPropertyDescriptor() : base() { } + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } private Elastic.Clients.Elasticsearch.Fields? CopyToValue { get; set; } @@ -138,21 +148,23 @@ public IntegerNumberPropertyDescriptor() : base() private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } - public IntegerNumberPropertyDescriptor Coerce(bool? coerce = true) + public IntegerNumberPropertyDescriptor Boost(double? boost) { - CoerceValue = coerce; + BoostValue = boost; return Self; } - public IntegerNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) + public IntegerNumberPropertyDescriptor Coerce(bool? coerce = true) { - CopyToValue = copyTo; + CoerceValue = coerce; return Self; } - public IntegerNumberPropertyDescriptor CopyTo(Expression> copyTo) + public IntegerNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) { CopyToValue = copyTo; return Self; @@ -270,6 +282,12 @@ public IntegerNumberPropertyDescriptor Store(bool? store = true) return Self; } + public IntegerNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + public IntegerNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; @@ -279,6 +297,12 @@ public IntegerNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clien protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + if (CoerceValue.HasValue) { writer.WritePropertyName("coerce"); @@ -375,6 +399,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(StoreValue.Value); } + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + if (TimeSeriesMetricValue is not null) { writer.WritePropertyName("time_series_metric"); @@ -387,7 +417,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } IntegerNumberProperty IBuildableDescriptor.Build() => new() - { Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesMetric = TimeSeriesMetricValue }; + { Boost = BoostValue, Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesDimension = TimeSeriesDimensionValue, TimeSeriesMetric = TimeSeriesMetricValue }; } public sealed partial class IntegerNumberPropertyDescriptor : SerializableDescriptorBase, IBuildableDescriptor @@ -397,6 +427,8 @@ public IntegerNumberPropertyDescriptor() : base() { } + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } private Elastic.Clients.Elasticsearch.Fields? CopyToValue { get; set; } @@ -429,27 +461,23 @@ public IntegerNumberPropertyDescriptor() : base() private bool? StoreValue { get; set; } - private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } - public IntegerNumberPropertyDescriptor Coerce(bool? coerce = true) - { - CoerceValue = coerce; - return Self; - } + private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } - public IntegerNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) + public IntegerNumberPropertyDescriptor Boost(double? boost) { - CopyToValue = copyTo; + BoostValue = boost; return Self; } - public IntegerNumberPropertyDescriptor CopyTo(Expression> copyTo) + public IntegerNumberPropertyDescriptor Coerce(bool? coerce = true) { - CopyToValue = copyTo; + CoerceValue = coerce; return Self; } - public IntegerNumberPropertyDescriptor CopyTo(Expression> copyTo) + public IntegerNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) { CopyToValue = copyTo; return Self; @@ -567,6 +595,12 @@ public IntegerNumberPropertyDescriptor Store(bool? store = true) return Self; } + public IntegerNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + public IntegerNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; @@ -576,6 +610,12 @@ public IntegerNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elastics protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + if (CoerceValue.HasValue) { writer.WritePropertyName("coerce"); @@ -672,6 +712,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(StoreValue.Value); } + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + if (TimeSeriesMetricValue is not null) { writer.WritePropertyName("time_series_metric"); @@ -684,6 +730,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } IntegerNumberProperty IBuildableDescriptor.Build() => new() - { Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesMetric = TimeSeriesMetricValue }; + { Boost = BoostValue, Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesDimension = TimeSeriesDimensionValue, TimeSeriesMetric = TimeSeriesMetricValue }; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerRangeProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerRangeProperty.g.cs index 5a4b0b3589c..1e6cc56d0e8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerRangeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IntegerRangeProperty.g.cs @@ -134,12 +134,6 @@ public IntegerRangePropertyDescriptor CopyTo(Elastic.Clients.Elastics return Self; } - public IntegerRangePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public IntegerRangePropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; @@ -369,18 +363,6 @@ public IntegerRangePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Field return Self; } - public IntegerRangePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - - public IntegerRangePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public IntegerRangePropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpProperty.g.cs index f4392a0c4b7..ac57c4cd092 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpProperty.g.cs @@ -70,10 +70,18 @@ public sealed partial class IpProperty : IProperty [JsonPropertyName("null_value")] public string? NullValue { get; set; } + [JsonInclude] + [JsonPropertyName("on_script_error")] + public Elastic.Clients.Elasticsearch.Mapping.OnScriptError? OnScriptError { get; set; } + [JsonInclude] [JsonPropertyName("properties")] public Elastic.Clients.Elasticsearch.Mapping.Properties? Properties { get; set; } + [JsonInclude] + [JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Script? Script { get; set; } + [JsonInclude] [JsonPropertyName("similarity")] public string? Similarity { get; set; } @@ -82,6 +90,10 @@ public sealed partial class IpProperty : IProperty [JsonPropertyName("store")] public bool? Store { get; set; } + [JsonInclude] + [JsonPropertyName("time_series_dimension")] + public bool? TimeSeriesDimension { get; set; } + [JsonInclude] [JsonPropertyName("type")] public string Type => "ip"; @@ -116,12 +128,18 @@ public IpPropertyDescriptor() : base() private string? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.OnScriptError? OnScriptErrorValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + private string? SimilarityValue { get; set; } private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + public IpPropertyDescriptor Boost(double? boost) { BoostValue = boost; @@ -134,12 +152,6 @@ public IpPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fiel return Self; } - public IpPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public IpPropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; @@ -208,6 +220,12 @@ public IpPropertyDescriptor NullValue(string? nullValue) return Self; } + public IpPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + public IpPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.Properties? properties) { PropertiesValue = properties; @@ -228,6 +246,12 @@ public IpPropertyDescriptor Properties(Action Script(Elastic.Clients.Elasticsearch.Script? script) + { + ScriptValue = script; + return Self; + } + public IpPropertyDescriptor Similarity(string? similarity) { SimilarityValue = similarity; @@ -240,6 +264,12 @@ public IpPropertyDescriptor Store(bool? store = true) return Self; } + public IpPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); @@ -309,12 +339,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteStringValue(NullValueValue); } + if (OnScriptErrorValue is not null) + { + writer.WritePropertyName("on_script_error"); + JsonSerializer.Serialize(writer, OnScriptErrorValue, options); + } + if (PropertiesValue is not null) { writer.WritePropertyName("properties"); JsonSerializer.Serialize(writer, PropertiesValue, options); } + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + if (!string.IsNullOrEmpty(SimilarityValue)) { writer.WritePropertyName("similarity"); @@ -327,13 +369,19 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(StoreValue.Value); } + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + writer.WritePropertyName("type"); writer.WriteStringValue("ip"); writer.WriteEndObject(); } IpProperty IBuildableDescriptor.Build() => new() - { Boost = BoostValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, Properties = PropertiesValue, Similarity = SimilarityValue, Store = StoreValue }; + { Boost = BoostValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesDimension = TimeSeriesDimensionValue }; } public sealed partial class IpPropertyDescriptor : SerializableDescriptorBase, IBuildableDescriptor @@ -365,12 +413,18 @@ public IpPropertyDescriptor() : base() private string? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.OnScriptError? OnScriptErrorValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + private string? SimilarityValue { get; set; } private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + public IpPropertyDescriptor Boost(double? boost) { BoostValue = boost; @@ -383,18 +437,6 @@ public IpPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) return Self; } - public IpPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - - public IpPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public IpPropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; @@ -463,6 +505,12 @@ public IpPropertyDescriptor NullValue(string? nullValue) return Self; } + public IpPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + public IpPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.Properties? properties) { PropertiesValue = properties; @@ -483,6 +531,12 @@ public IpPropertyDescriptor Properties(Action.Build() => new() - { Boost = BoostValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, Properties = PropertiesValue, Similarity = SimilarityValue, Store = StoreValue }; + { Boost = BoostValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesDimension = TimeSeriesDimensionValue }; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpRangeProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpRangeProperty.g.cs index 6b617920ff6..d362bcd656d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpRangeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/IpRangeProperty.g.cs @@ -134,12 +134,6 @@ public IpRangePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch return Self; } - public IpRangePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public IpRangePropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; @@ -369,18 +363,6 @@ public IpRangePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? co return Self; } - public IpRangePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - - public IpRangePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public IpRangePropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/JoinProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/JoinProperty.g.cs index 9dfa7b1a7ff..06c954664c9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/JoinProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/JoinProperty.g.cs @@ -30,6 +30,10 @@ public sealed partial class JoinProperty : IProperty [JsonPropertyName("dynamic")] public Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? Dynamic { get; set; } + [JsonInclude] + [JsonPropertyName("eager_global_ordinals")] + public bool? EagerGlobalOrdinals { get; set; } + [JsonInclude] [JsonPropertyName("fields")] public Elastic.Clients.Elasticsearch.Mapping.Properties? Fields { get; set; } @@ -68,6 +72,8 @@ public JoinPropertyDescriptor() : base() private Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? DynamicValue { get; set; } + private bool? EagerGlobalOrdinalsValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.Properties? FieldsValue { get; set; } private int? IgnoreAboveValue { get; set; } @@ -86,6 +92,12 @@ public JoinPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.M return Self; } + public JoinPropertyDescriptor EagerGlobalOrdinals(bool? eagerGlobalOrdinals = true) + { + EagerGlobalOrdinalsValue = eagerGlobalOrdinals; + return Self; + } + public JoinPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.Properties? fields) { FieldsValue = fields; @@ -159,6 +171,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, DynamicValue, options); } + if (EagerGlobalOrdinalsValue.HasValue) + { + writer.WritePropertyName("eager_global_ordinals"); + writer.WriteBooleanValue(EagerGlobalOrdinalsValue.Value); + } + if (FieldsValue is not null) { writer.WritePropertyName("fields"); @@ -201,7 +219,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } JoinProperty IBuildableDescriptor.Build() => new() - { Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, Properties = PropertiesValue, Relations = RelationsValue }; + { Dynamic = DynamicValue, EagerGlobalOrdinals = EagerGlobalOrdinalsValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, Properties = PropertiesValue, Relations = RelationsValue }; } public sealed partial class JoinPropertyDescriptor : SerializableDescriptorBase, IBuildableDescriptor @@ -213,6 +231,8 @@ public JoinPropertyDescriptor() : base() private Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? DynamicValue { get; set; } + private bool? EagerGlobalOrdinalsValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.Properties? FieldsValue { get; set; } private int? IgnoreAboveValue { get; set; } @@ -231,6 +251,12 @@ public JoinPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Mapping.Dyna return Self; } + public JoinPropertyDescriptor EagerGlobalOrdinals(bool? eagerGlobalOrdinals = true) + { + EagerGlobalOrdinalsValue = eagerGlobalOrdinals; + return Self; + } + public JoinPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.Properties? fields) { FieldsValue = fields; @@ -304,6 +330,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, DynamicValue, options); } + if (EagerGlobalOrdinalsValue.HasValue) + { + writer.WritePropertyName("eager_global_ordinals"); + writer.WriteBooleanValue(EagerGlobalOrdinalsValue.Value); + } + if (FieldsValue is not null) { writer.WritePropertyName("fields"); @@ -346,6 +378,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } JoinProperty IBuildableDescriptor.Build() => new() - { Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, Properties = PropertiesValue, Relations = RelationsValue }; + { Dynamic = DynamicValue, EagerGlobalOrdinals = EagerGlobalOrdinalsValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, Properties = PropertiesValue, Relations = RelationsValue }; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/KeywordProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/KeywordProperty.g.cs index 46c26a876ec..c76f868952b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/KeywordProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/KeywordProperty.g.cs @@ -164,12 +164,6 @@ public KeywordPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch return Self; } - public KeywordPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public KeywordPropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; @@ -483,18 +477,6 @@ public KeywordPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? co return Self; } - public KeywordPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - - public KeywordPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public KeywordPropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongNumberProperty.g.cs index a39aa9d5b13..07b9e6a7ccf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongNumberProperty.g.cs @@ -26,6 +26,10 @@ namespace Elastic.Clients.Elasticsearch.Mapping { public sealed partial class LongNumberProperty : IProperty { + [JsonInclude] + [JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude] [JsonPropertyName("coerce")] public bool? Coerce { get; set; } @@ -90,6 +94,10 @@ public sealed partial class LongNumberProperty : IProperty [JsonPropertyName("store")] public bool? Store { get; set; } + [JsonInclude] + [JsonPropertyName("time_series_dimension")] + public bool? TimeSeriesDimension { get; set; } + [JsonInclude] [JsonPropertyName("time_series_metric")] public Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } @@ -106,6 +114,8 @@ public LongNumberPropertyDescriptor() : base() { } + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } private Elastic.Clients.Elasticsearch.Fields? CopyToValue { get; set; } @@ -138,21 +148,23 @@ public LongNumberPropertyDescriptor() : base() private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } - public LongNumberPropertyDescriptor Coerce(bool? coerce = true) + public LongNumberPropertyDescriptor Boost(double? boost) { - CoerceValue = coerce; + BoostValue = boost; return Self; } - public LongNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) + public LongNumberPropertyDescriptor Coerce(bool? coerce = true) { - CopyToValue = copyTo; + CoerceValue = coerce; return Self; } - public LongNumberPropertyDescriptor CopyTo(Expression> copyTo) + public LongNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) { CopyToValue = copyTo; return Self; @@ -270,6 +282,12 @@ public LongNumberPropertyDescriptor Store(bool? store = true) return Self; } + public LongNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + public LongNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; @@ -279,6 +297,12 @@ public LongNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients. protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + if (CoerceValue.HasValue) { writer.WritePropertyName("coerce"); @@ -375,6 +399,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(StoreValue.Value); } + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + if (TimeSeriesMetricValue is not null) { writer.WritePropertyName("time_series_metric"); @@ -387,7 +417,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } LongNumberProperty IBuildableDescriptor.Build() => new() - { Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesMetric = TimeSeriesMetricValue }; + { Boost = BoostValue, Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesDimension = TimeSeriesDimensionValue, TimeSeriesMetric = TimeSeriesMetricValue }; } public sealed partial class LongNumberPropertyDescriptor : SerializableDescriptorBase, IBuildableDescriptor @@ -397,6 +427,8 @@ public LongNumberPropertyDescriptor() : base() { } + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } private Elastic.Clients.Elasticsearch.Fields? CopyToValue { get; set; } @@ -429,27 +461,23 @@ public LongNumberPropertyDescriptor() : base() private bool? StoreValue { get; set; } - private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } - public LongNumberPropertyDescriptor Coerce(bool? coerce = true) - { - CoerceValue = coerce; - return Self; - } + private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } - public LongNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) + public LongNumberPropertyDescriptor Boost(double? boost) { - CopyToValue = copyTo; + BoostValue = boost; return Self; } - public LongNumberPropertyDescriptor CopyTo(Expression> copyTo) + public LongNumberPropertyDescriptor Coerce(bool? coerce = true) { - CopyToValue = copyTo; + CoerceValue = coerce; return Self; } - public LongNumberPropertyDescriptor CopyTo(Expression> copyTo) + public LongNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) { CopyToValue = copyTo; return Self; @@ -567,6 +595,12 @@ public LongNumberPropertyDescriptor Store(bool? store = true) return Self; } + public LongNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + public LongNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; @@ -576,6 +610,12 @@ public LongNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsear protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + if (CoerceValue.HasValue) { writer.WritePropertyName("coerce"); @@ -672,6 +712,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(StoreValue.Value); } + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + if (TimeSeriesMetricValue is not null) { writer.WritePropertyName("time_series_metric"); @@ -684,6 +730,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } LongNumberProperty IBuildableDescriptor.Build() => new() - { Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesMetric = TimeSeriesMetricValue }; + { Boost = BoostValue, Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesDimension = TimeSeriesDimensionValue, TimeSeriesMetric = TimeSeriesMetricValue }; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongRangeProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongRangeProperty.g.cs index f4417fdcb17..66c7ed2fb84 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongRangeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/LongRangeProperty.g.cs @@ -134,12 +134,6 @@ public LongRangePropertyDescriptor CopyTo(Elastic.Clients.Elasticsear return Self; } - public LongRangePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public LongRangePropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; @@ -369,18 +363,6 @@ public LongRangePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? return Self; } - public LongRangePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - - public LongRangePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public LongRangePropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/MatchOnlyTextProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/MatchOnlyTextProperty.g.cs index 5702ff51ab9..56b9cb6988c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/MatchOnlyTextProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/MatchOnlyTextProperty.g.cs @@ -62,12 +62,6 @@ public MatchOnlyTextPropertyDescriptor CopyTo(Elastic.Clients.Elastic return Self; } - public MatchOnlyTextPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public MatchOnlyTextPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.Properties? fields) { FieldsValue = fields; @@ -143,18 +137,6 @@ public MatchOnlyTextPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fiel return Self; } - public MatchOnlyTextPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - - public MatchOnlyTextPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public MatchOnlyTextPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.Properties? fields) { FieldsValue = fields; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Murmur3HashProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Murmur3HashProperty.g.cs index cb396562878..a04529d864f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Murmur3HashProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/Murmur3HashProperty.g.cs @@ -104,12 +104,6 @@ public Murmur3HashPropertyDescriptor CopyTo(Elastic.Clients.Elasticse return Self; } - public Murmur3HashPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public Murmur3HashPropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; @@ -297,18 +291,6 @@ public Murmur3HashPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields return Self; } - public Murmur3HashPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - - public Murmur3HashPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public Murmur3HashPropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/NestedProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/NestedProperty.g.cs index 98424c7670b..29f814cbc94 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/NestedProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/NestedProperty.g.cs @@ -116,12 +116,6 @@ public NestedPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch. return Self; } - public NestedPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public NestedPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? dynamic) { DynamicValue = dynamic; @@ -337,18 +331,6 @@ public NestedPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? cop return Self; } - public NestedPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - - public NestedPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public NestedPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? dynamic) { DynamicValue = dynamic; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ObjectProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ObjectProperty.g.cs index 9318e8ab4f2..f98fe95efdf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ObjectProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ObjectProperty.g.cs @@ -104,12 +104,6 @@ public ObjectPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch. return Self; } - public ObjectPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public ObjectPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? dynamic) { DynamicValue = dynamic; @@ -297,18 +291,6 @@ public ObjectPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? cop return Self; } - public ObjectPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - - public ObjectPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public ObjectPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? dynamic) { DynamicValue = dynamic; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PointProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PointProperty.g.cs index f82dce6e0b0..490e7f8c241 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PointProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/PointProperty.g.cs @@ -122,12 +122,6 @@ public PointPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.F return Self; } - public PointPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public PointPropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; @@ -357,18 +351,6 @@ public PointPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copy return Self; } - public PointPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - - public PointPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public PointPropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ScaledFloatNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ScaledFloatNumberProperty.g.cs index cd7a2215091..1e269ee9760 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ScaledFloatNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ScaledFloatNumberProperty.g.cs @@ -26,6 +26,10 @@ namespace Elastic.Clients.Elasticsearch.Mapping { public sealed partial class ScaledFloatNumberProperty : IProperty { + [JsonInclude] + [JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude] [JsonPropertyName("coerce")] public bool? Coerce { get; set; } @@ -70,6 +74,10 @@ public sealed partial class ScaledFloatNumberProperty : IProperty [JsonPropertyName("null_value")] public double? NullValue { get; set; } + [JsonInclude] + [JsonPropertyName("on_script_error")] + public Elastic.Clients.Elasticsearch.Mapping.OnScriptError? OnScriptError { get; set; } + [JsonInclude] [JsonPropertyName("properties")] public Elastic.Clients.Elasticsearch.Mapping.Properties? Properties { get; set; } @@ -78,6 +86,10 @@ public sealed partial class ScaledFloatNumberProperty : IProperty [JsonPropertyName("scaling_factor")] public double? ScalingFactor { get; set; } + [JsonInclude] + [JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Script? Script { get; set; } + [JsonInclude] [JsonPropertyName("similarity")] public string? Similarity { get; set; } @@ -86,6 +98,10 @@ public sealed partial class ScaledFloatNumberProperty : IProperty [JsonPropertyName("store")] public bool? Store { get; set; } + [JsonInclude] + [JsonPropertyName("time_series_dimension")] + public bool? TimeSeriesDimension { get; set; } + [JsonInclude] [JsonPropertyName("time_series_metric")] public Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } @@ -102,6 +118,8 @@ public ScaledFloatNumberPropertyDescriptor() : base() { } + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } private Elastic.Clients.Elasticsearch.Fields? CopyToValue { get; set; } @@ -124,29 +142,35 @@ public ScaledFloatNumberPropertyDescriptor() : base() private double? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.OnScriptError? OnScriptErrorValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; } private double? ScalingFactorValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + private string? SimilarityValue { get; set; } private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } - public ScaledFloatNumberPropertyDescriptor Coerce(bool? coerce = true) + public ScaledFloatNumberPropertyDescriptor Boost(double? boost) { - CoerceValue = coerce; + BoostValue = boost; return Self; } - public ScaledFloatNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) + public ScaledFloatNumberPropertyDescriptor Coerce(bool? coerce = true) { - CopyToValue = copyTo; + CoerceValue = coerce; return Self; } - public ScaledFloatNumberPropertyDescriptor CopyTo(Expression> copyTo) + public ScaledFloatNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) { CopyToValue = copyTo; return Self; @@ -220,6 +244,12 @@ public ScaledFloatNumberPropertyDescriptor NullValue(double? nullValu return Self; } + public ScaledFloatNumberPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + public ScaledFloatNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.Properties? properties) { PropertiesValue = properties; @@ -246,6 +276,12 @@ public ScaledFloatNumberPropertyDescriptor ScalingFactor(double? scal return Self; } + public ScaledFloatNumberPropertyDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) + { + ScriptValue = script; + return Self; + } + public ScaledFloatNumberPropertyDescriptor Similarity(string? similarity) { SimilarityValue = similarity; @@ -258,6 +294,12 @@ public ScaledFloatNumberPropertyDescriptor Store(bool? store = true) return Self; } + public ScaledFloatNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + public ScaledFloatNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; @@ -267,6 +309,12 @@ public ScaledFloatNumberPropertyDescriptor TimeSeriesMetric(Elastic.C protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + if (CoerceValue.HasValue) { writer.WritePropertyName("coerce"); @@ -333,6 +381,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(NullValueValue.Value); } + if (OnScriptErrorValue is not null) + { + writer.WritePropertyName("on_script_error"); + JsonSerializer.Serialize(writer, OnScriptErrorValue, options); + } + if (PropertiesValue is not null) { writer.WritePropertyName("properties"); @@ -345,6 +399,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(ScalingFactorValue.Value); } + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + if (!string.IsNullOrEmpty(SimilarityValue)) { writer.WritePropertyName("similarity"); @@ -357,6 +417,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(StoreValue.Value); } + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + if (TimeSeriesMetricValue is not null) { writer.WritePropertyName("time_series_metric"); @@ -369,7 +435,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } ScaledFloatNumberProperty IBuildableDescriptor.Build() => new() - { Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, Properties = PropertiesValue, ScalingFactor = ScalingFactorValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesMetric = TimeSeriesMetricValue }; + { Boost = BoostValue, Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, ScalingFactor = ScalingFactorValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesDimension = TimeSeriesDimensionValue, TimeSeriesMetric = TimeSeriesMetricValue }; } public sealed partial class ScaledFloatNumberPropertyDescriptor : SerializableDescriptorBase, IBuildableDescriptor @@ -379,6 +445,8 @@ public ScaledFloatNumberPropertyDescriptor() : base() { } + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } private Elastic.Clients.Elasticsearch.Fields? CopyToValue { get; set; } @@ -401,35 +469,35 @@ public ScaledFloatNumberPropertyDescriptor() : base() private double? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.OnScriptError? OnScriptErrorValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; } private double? ScalingFactorValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + private string? SimilarityValue { get; set; } private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } - public ScaledFloatNumberPropertyDescriptor Coerce(bool? coerce = true) + public ScaledFloatNumberPropertyDescriptor Boost(double? boost) { - CoerceValue = coerce; + BoostValue = boost; return Self; } - public ScaledFloatNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) - { - CopyToValue = copyTo; - return Self; - } - - public ScaledFloatNumberPropertyDescriptor CopyTo(Expression> copyTo) + public ScaledFloatNumberPropertyDescriptor Coerce(bool? coerce = true) { - CopyToValue = copyTo; + CoerceValue = coerce; return Self; } - public ScaledFloatNumberPropertyDescriptor CopyTo(Expression> copyTo) + public ScaledFloatNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) { CopyToValue = copyTo; return Self; @@ -503,6 +571,12 @@ public ScaledFloatNumberPropertyDescriptor NullValue(double? nullValue) return Self; } + public ScaledFloatNumberPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + public ScaledFloatNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.Properties? properties) { PropertiesValue = properties; @@ -529,6 +603,12 @@ public ScaledFloatNumberPropertyDescriptor ScalingFactor(double? scalingFactor) return Self; } + public ScaledFloatNumberPropertyDescriptor Script(Elastic.Clients.Elasticsearch.Script? script) + { + ScriptValue = script; + return Self; + } + public ScaledFloatNumberPropertyDescriptor Similarity(string? similarity) { SimilarityValue = similarity; @@ -541,6 +621,12 @@ public ScaledFloatNumberPropertyDescriptor Store(bool? store = true) return Self; } + public ScaledFloatNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + public ScaledFloatNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; @@ -550,6 +636,12 @@ public ScaledFloatNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elas protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + if (CoerceValue.HasValue) { writer.WritePropertyName("coerce"); @@ -616,6 +708,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(NullValueValue.Value); } + if (OnScriptErrorValue is not null) + { + writer.WritePropertyName("on_script_error"); + JsonSerializer.Serialize(writer, OnScriptErrorValue, options); + } + if (PropertiesValue is not null) { writer.WritePropertyName("properties"); @@ -628,6 +726,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(ScalingFactorValue.Value); } + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + if (!string.IsNullOrEmpty(SimilarityValue)) { writer.WritePropertyName("similarity"); @@ -640,6 +744,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(StoreValue.Value); } + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + if (TimeSeriesMetricValue is not null) { writer.WritePropertyName("time_series_metric"); @@ -652,6 +762,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } ScaledFloatNumberProperty IBuildableDescriptor.Build() => new() - { Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, Properties = PropertiesValue, ScalingFactor = ScalingFactorValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesMetric = TimeSeriesMetricValue }; + { Boost = BoostValue, Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, ScalingFactor = ScalingFactorValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesDimension = TimeSeriesDimensionValue, TimeSeriesMetric = TimeSeriesMetricValue }; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SearchAsYouTypeProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SearchAsYouTypeProperty.g.cs index 19a442c5876..6a2d6c91445 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SearchAsYouTypeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SearchAsYouTypeProperty.g.cs @@ -152,12 +152,6 @@ public SearchAsYouTypePropertyDescriptor CopyTo(Elastic.Clients.Elast return Self; } - public SearchAsYouTypePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public SearchAsYouTypePropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? dynamic) { DynamicValue = dynamic; @@ -443,18 +437,6 @@ public SearchAsYouTypePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fi return Self; } - public SearchAsYouTypePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - - public SearchAsYouTypePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public SearchAsYouTypePropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? dynamic) { DynamicValue = dynamic; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShapeProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShapeProperty.g.cs index 3a241fe5294..14a71d841db 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShapeProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShapeProperty.g.cs @@ -134,12 +134,6 @@ public ShapePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.F return Self; } - public ShapePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public ShapePropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; @@ -383,18 +377,6 @@ public ShapePropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copy return Self; } - public ShapePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - - public ShapePropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public ShapePropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShortNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShortNumberProperty.g.cs index 6702c77b1b9..fa9429e6a21 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShortNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ShortNumberProperty.g.cs @@ -26,6 +26,10 @@ namespace Elastic.Clients.Elasticsearch.Mapping { public sealed partial class ShortNumberProperty : IProperty { + [JsonInclude] + [JsonPropertyName("boost")] + public double? Boost { get; set; } + [JsonInclude] [JsonPropertyName("coerce")] public bool? Coerce { get; set; } @@ -90,6 +94,10 @@ public sealed partial class ShortNumberProperty : IProperty [JsonPropertyName("store")] public bool? Store { get; set; } + [JsonInclude] + [JsonPropertyName("time_series_dimension")] + public bool? TimeSeriesDimension { get; set; } + [JsonInclude] [JsonPropertyName("time_series_metric")] public Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } @@ -106,6 +114,8 @@ public ShortNumberPropertyDescriptor() : base() { } + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } private Elastic.Clients.Elasticsearch.Fields? CopyToValue { get; set; } @@ -138,21 +148,23 @@ public ShortNumberPropertyDescriptor() : base() private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } - public ShortNumberPropertyDescriptor Coerce(bool? coerce = true) + public ShortNumberPropertyDescriptor Boost(double? boost) { - CoerceValue = coerce; + BoostValue = boost; return Self; } - public ShortNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) + public ShortNumberPropertyDescriptor Coerce(bool? coerce = true) { - CopyToValue = copyTo; + CoerceValue = coerce; return Self; } - public ShortNumberPropertyDescriptor CopyTo(Expression> copyTo) + public ShortNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) { CopyToValue = copyTo; return Self; @@ -270,6 +282,12 @@ public ShortNumberPropertyDescriptor Store(bool? store = true) return Self; } + public ShortNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + public ShortNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; @@ -279,6 +297,12 @@ public ShortNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + if (CoerceValue.HasValue) { writer.WritePropertyName("coerce"); @@ -375,6 +399,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(StoreValue.Value); } + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + if (TimeSeriesMetricValue is not null) { writer.WritePropertyName("time_series_metric"); @@ -387,7 +417,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } ShortNumberProperty IBuildableDescriptor.Build() => new() - { Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesMetric = TimeSeriesMetricValue }; + { Boost = BoostValue, Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesDimension = TimeSeriesDimensionValue, TimeSeriesMetric = TimeSeriesMetricValue }; } public sealed partial class ShortNumberPropertyDescriptor : SerializableDescriptorBase, IBuildableDescriptor @@ -397,6 +427,8 @@ public ShortNumberPropertyDescriptor() : base() { } + private double? BoostValue { get; set; } + private bool? CoerceValue { get; set; } private Elastic.Clients.Elasticsearch.Fields? CopyToValue { get; set; } @@ -429,27 +461,23 @@ public ShortNumberPropertyDescriptor() : base() private bool? StoreValue { get; set; } - private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } - public ShortNumberPropertyDescriptor Coerce(bool? coerce = true) - { - CoerceValue = coerce; - return Self; - } + private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } - public ShortNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) + public ShortNumberPropertyDescriptor Boost(double? boost) { - CopyToValue = copyTo; + BoostValue = boost; return Self; } - public ShortNumberPropertyDescriptor CopyTo(Expression> copyTo) + public ShortNumberPropertyDescriptor Coerce(bool? coerce = true) { - CopyToValue = copyTo; + CoerceValue = coerce; return Self; } - public ShortNumberPropertyDescriptor CopyTo(Expression> copyTo) + public ShortNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) { CopyToValue = copyTo; return Self; @@ -567,6 +595,12 @@ public ShortNumberPropertyDescriptor Store(bool? store = true) return Self; } + public ShortNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + public ShortNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; @@ -576,6 +610,12 @@ public ShortNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsea protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + if (CoerceValue.HasValue) { writer.WritePropertyName("coerce"); @@ -672,6 +712,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(StoreValue.Value); } + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + if (TimeSeriesMetricValue is not null) { writer.WritePropertyName("time_series_metric"); @@ -684,6 +730,6 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } ShortNumberProperty IBuildableDescriptor.Build() => new() - { Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesMetric = TimeSeriesMetricValue }; + { Boost = BoostValue, Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesDimension = TimeSeriesDimensionValue, TimeSeriesMetric = TimeSeriesMetricValue }; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SourceField.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SourceField.g.cs index e417957d267..a1b339a59dc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SourceField.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SourceField.g.cs @@ -45,6 +45,10 @@ public sealed partial class SourceField [JsonInclude] [JsonPropertyName("includes")] public IEnumerable? Includes { get; set; } + + [JsonInclude] + [JsonPropertyName("mode")] + public Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode? Mode { get; set; } } public sealed partial class SourceFieldDescriptor : SerializableDescriptorBase @@ -64,6 +68,8 @@ public SourceFieldDescriptor() : base() private IEnumerable? IncludesValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode? ModeValue { get; set; } + public SourceFieldDescriptor Compress(bool? compress = true) { CompressValue = compress; @@ -94,6 +100,12 @@ public SourceFieldDescriptor Includes(IEnumerable? includes) return Self; } + public SourceFieldDescriptor Mode(Elastic.Clients.Elasticsearch.Mapping.SourceFieldMode? mode) + { + ModeValue = mode; + return Self; + } + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); @@ -127,6 +139,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o JsonSerializer.Serialize(writer, IncludesValue, options); } + if (ModeValue is not null) + { + writer.WritePropertyName("mode"); + JsonSerializer.Serialize(writer, ModeValue, options); + } + writer.WriteEndObject(); } } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TextProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TextProperty.g.cs index 8250db8e3e1..05b4d5a7fc5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TextProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TextProperty.g.cs @@ -202,12 +202,6 @@ public TextPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fi return Self; } - public TextPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public TextPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? dynamic) { DynamicValue = dynamic; @@ -689,18 +683,6 @@ public TextPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyT return Self; } - public TextPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - - public TextPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public TextPropertyDescriptor Dynamic(Elastic.Clients.Elasticsearch.Mapping.DynamicMapping? dynamic) { DynamicValue = dynamic; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TokenCountProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TokenCountProperty.g.cs index 990bebc8935..7731b2e414f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TokenCountProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/TokenCountProperty.g.cs @@ -146,12 +146,6 @@ public TokenCountPropertyDescriptor CopyTo(Elastic.Clients.Elasticsea return Self; } - public TokenCountPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public TokenCountPropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; @@ -409,18 +403,6 @@ public TokenCountPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? return Self; } - public TokenCountPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - - public TokenCountPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public TokenCountPropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/UnsignedLongNumberProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/UnsignedLongNumberProperty.g.cs index bf478e86713..d51890aa781 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/UnsignedLongNumberProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/UnsignedLongNumberProperty.g.cs @@ -26,6 +26,14 @@ namespace Elastic.Clients.Elasticsearch.Mapping { public sealed partial class UnsignedLongNumberProperty : IProperty { + [JsonInclude] + [JsonPropertyName("boost")] + public double? Boost { get; set; } + + [JsonInclude] + [JsonPropertyName("coerce")] + public bool? Coerce { get; set; } + [JsonInclude] [JsonPropertyName("copy_to")] public Elastic.Clients.Elasticsearch.Fields? CopyTo { get; set; } @@ -66,10 +74,18 @@ public sealed partial class UnsignedLongNumberProperty : IProperty [JsonPropertyName("null_value")] public long? NullValue { get; set; } + [JsonInclude] + [JsonPropertyName("on_script_error")] + public Elastic.Clients.Elasticsearch.Mapping.OnScriptError? OnScriptError { get; set; } + [JsonInclude] [JsonPropertyName("properties")] public Elastic.Clients.Elasticsearch.Mapping.Properties? Properties { get; set; } + [JsonInclude] + [JsonPropertyName("script")] + public Elastic.Clients.Elasticsearch.Script? Script { get; set; } + [JsonInclude] [JsonPropertyName("similarity")] public string? Similarity { get; set; } @@ -78,6 +94,10 @@ public sealed partial class UnsignedLongNumberProperty : IProperty [JsonPropertyName("store")] public bool? Store { get; set; } + [JsonInclude] + [JsonPropertyName("time_series_dimension")] + public bool? TimeSeriesDimension { get; set; } + [JsonInclude] [JsonPropertyName("time_series_metric")] public Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetric { get; set; } @@ -94,6 +114,10 @@ public UnsignedLongNumberPropertyDescriptor() : base() { } + private double? BoostValue { get; set; } + + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Fields? CopyToValue { get; set; } private bool? DocValuesValue { get; set; } @@ -114,21 +138,33 @@ public UnsignedLongNumberPropertyDescriptor() : base() private long? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.OnScriptError? OnScriptErrorValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + private string? SimilarityValue { get; set; } private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } - public UnsignedLongNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) + public UnsignedLongNumberPropertyDescriptor Boost(double? boost) { - CopyToValue = copyTo; + BoostValue = boost; return Self; } - public UnsignedLongNumberPropertyDescriptor CopyTo(Expression> copyTo) + public UnsignedLongNumberPropertyDescriptor Coerce(bool? coerce = true) + { + CoerceValue = coerce; + return Self; + } + + public UnsignedLongNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) { CopyToValue = copyTo; return Self; @@ -202,6 +238,12 @@ public UnsignedLongNumberPropertyDescriptor NullValue(long? nullValue return Self; } + public UnsignedLongNumberPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + public UnsignedLongNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.Properties? properties) { PropertiesValue = properties; @@ -222,6 +264,12 @@ public UnsignedLongNumberPropertyDescriptor Properties(Action Script(Elastic.Clients.Elasticsearch.Script? script) + { + ScriptValue = script; + return Self; + } + public UnsignedLongNumberPropertyDescriptor Similarity(string? similarity) { SimilarityValue = similarity; @@ -234,6 +282,12 @@ public UnsignedLongNumberPropertyDescriptor Store(bool? store = true) return Self; } + public UnsignedLongNumberPropertyDescriptor TimeSeriesDimension(bool? timeSeriesDimension = true) + { + TimeSeriesDimensionValue = timeSeriesDimension; + return Self; + } + public UnsignedLongNumberPropertyDescriptor TimeSeriesMetric(Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? timeSeriesMetric) { TimeSeriesMetricValue = timeSeriesMetric; @@ -243,6 +297,18 @@ public UnsignedLongNumberPropertyDescriptor TimeSeriesMetric(Elastic. protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); + if (BoostValue.HasValue) + { + writer.WritePropertyName("boost"); + writer.WriteNumberValue(BoostValue.Value); + } + + if (CoerceValue.HasValue) + { + writer.WritePropertyName("coerce"); + writer.WriteBooleanValue(CoerceValue.Value); + } + if (CopyToValue is not null) { writer.WritePropertyName("copy_to"); @@ -303,12 +369,24 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteNumberValue(NullValueValue.Value); } + if (OnScriptErrorValue is not null) + { + writer.WritePropertyName("on_script_error"); + JsonSerializer.Serialize(writer, OnScriptErrorValue, options); + } + if (PropertiesValue is not null) { writer.WritePropertyName("properties"); JsonSerializer.Serialize(writer, PropertiesValue, options); } + if (ScriptValue is not null) + { + writer.WritePropertyName("script"); + JsonSerializer.Serialize(writer, ScriptValue, options); + } + if (!string.IsNullOrEmpty(SimilarityValue)) { writer.WritePropertyName("similarity"); @@ -321,6 +399,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(StoreValue.Value); } + if (TimeSeriesDimensionValue.HasValue) + { + writer.WritePropertyName("time_series_dimension"); + writer.WriteBooleanValue(TimeSeriesDimensionValue.Value); + } + if (TimeSeriesMetricValue is not null) { writer.WritePropertyName("time_series_metric"); @@ -333,7 +417,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } UnsignedLongNumberProperty IBuildableDescriptor.Build() => new() - { CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, Properties = PropertiesValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesMetric = TimeSeriesMetricValue }; + { Boost = BoostValue, Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesDimension = TimeSeriesDimensionValue, TimeSeriesMetric = TimeSeriesMetricValue }; } public sealed partial class UnsignedLongNumberPropertyDescriptor : SerializableDescriptorBase, IBuildableDescriptor @@ -343,6 +427,10 @@ public UnsignedLongNumberPropertyDescriptor() : base() { } + private double? BoostValue { get; set; } + + private bool? CoerceValue { get; set; } + private Elastic.Clients.Elasticsearch.Fields? CopyToValue { get; set; } private bool? DocValuesValue { get; set; } @@ -363,27 +451,33 @@ public UnsignedLongNumberPropertyDescriptor() : base() private long? NullValueValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.OnScriptError? OnScriptErrorValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.Properties? PropertiesValue { get; set; } + private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } + private string? SimilarityValue { get; set; } private bool? StoreValue { get; set; } + private bool? TimeSeriesDimensionValue { get; set; } + private Elastic.Clients.Elasticsearch.Mapping.TimeSeriesMetricType? TimeSeriesMetricValue { get; set; } - public UnsignedLongNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) + public UnsignedLongNumberPropertyDescriptor Boost(double? boost) { - CopyToValue = copyTo; + BoostValue = boost; return Self; } - public UnsignedLongNumberPropertyDescriptor CopyTo(Expression> copyTo) + public UnsignedLongNumberPropertyDescriptor Coerce(bool? coerce = true) { - CopyToValue = copyTo; + CoerceValue = coerce; return Self; } - public UnsignedLongNumberPropertyDescriptor CopyTo(Expression> copyTo) + public UnsignedLongNumberPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? copyTo) { CopyToValue = copyTo; return Self; @@ -457,6 +551,12 @@ public UnsignedLongNumberPropertyDescriptor NullValue(long? nullValue) return Self; } + public UnsignedLongNumberPropertyDescriptor OnScriptError(Elastic.Clients.Elasticsearch.Mapping.OnScriptError? onScriptError) + { + OnScriptErrorValue = onScriptError; + return Self; + } + public UnsignedLongNumberPropertyDescriptor Properties(Elastic.Clients.Elasticsearch.Mapping.Properties? properties) { PropertiesValue = properties; @@ -477,6 +577,12 @@ public UnsignedLongNumberPropertyDescriptor Properties(Action.Build() => new() - { CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, Properties = PropertiesValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesMetric = TimeSeriesMetricValue }; + { Boost = BoostValue, Coerce = CoerceValue, CopyTo = CopyToValue, DocValues = DocValuesValue, Dynamic = DynamicValue, Fields = FieldsValue, IgnoreAbove = IgnoreAboveValue, IgnoreMalformed = IgnoreMalformedValue, Index = IndexValue, LocalMetadata = LocalMetadataValue, Meta = MetaValue, NullValue = NullValueValue, OnScriptError = OnScriptErrorValue, Properties = PropertiesValue, Script = ScriptValue, Similarity = SimilarityValue, Store = StoreValue, TimeSeriesDimension = TimeSeriesDimensionValue, TimeSeriesMetric = TimeSeriesMetricValue }; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/VersionProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/VersionProperty.g.cs index d6edea017dd..01d864aa5b1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/VersionProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/VersionProperty.g.cs @@ -104,12 +104,6 @@ public VersionPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch return Self; } - public VersionPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public VersionPropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; @@ -297,18 +291,6 @@ public VersionPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? co return Self; } - public VersionPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - - public VersionPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public VersionPropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/WildcardProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/WildcardProperty.g.cs index facb4ead211..113f3d5be84 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/WildcardProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/WildcardProperty.g.cs @@ -110,12 +110,6 @@ public WildcardPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearc return Self; } - public WildcardPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public WildcardPropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; @@ -317,18 +311,6 @@ public WildcardPropertyDescriptor CopyTo(Elastic.Clients.Elasticsearch.Fields? c return Self; } - public WildcardPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - - public WildcardPropertyDescriptor CopyTo(Expression> copyTo) - { - CopyToValue = copyTo; - return Self; - } - public WildcardPropertyDescriptor DocValues(bool? docValues = true) { DocValuesValue = docValues; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MultisearchBody.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MultisearchBody.g.cs index c3d44b8ce8d..cdc7d071df1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MultisearchBody.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MultisearchBody.g.cs @@ -152,7 +152,7 @@ public override MultisearchBody Read(ref Utf8JsonReader reader, Type typeToConve if (property == "search_after") { - variant.SearchAfter = JsonSerializer.Deserialize?>(ref reader, options); + variant.SearchAfter = JsonSerializer.Deserialize?>(ref reader, options); continue; } @@ -461,7 +461,7 @@ public sealed partial class MultisearchBody public Dictionary? ScriptFields { get; set; } - public IEnumerable? SearchAfter { get; set; } + public IEnumerable? SearchAfter { get; set; } public bool? SeqNoPrimaryTerm { get; set; } @@ -574,7 +574,7 @@ public MultisearchBodyDescriptor() : base() private Dictionary? ScriptFieldsValue { get; set; } - private IEnumerable? SearchAfterValue { get; set; } + private IEnumerable? SearchAfterValue { get; set; } private bool? SeqNoPrimaryTermValue { get; set; } @@ -914,7 +914,7 @@ public MultisearchBodyDescriptor ScriptFields(Func SearchAfter(IEnumerable? searchAfter) + public MultisearchBodyDescriptor SearchAfter(IEnumerable? searchAfter) { SearchAfterValue = searchAfter; return Self; @@ -950,12 +950,6 @@ public MultisearchBodyDescriptor StoredFields(Elastic.Clients.Elastic return Self; } - public MultisearchBodyDescriptor StoredFields(Expression> storedFields) - { - StoredFieldsValue = storedFields; - return Self; - } - public MultisearchBodyDescriptor Suggest(Elastic.Clients.Elasticsearch.Suggester? suggest) { SuggestDescriptor = null; @@ -1435,7 +1429,7 @@ public MultisearchBodyDescriptor() : base() private Dictionary? ScriptFieldsValue { get; set; } - private IEnumerable? SearchAfterValue { get; set; } + private IEnumerable? SearchAfterValue { get; set; } private bool? SeqNoPrimaryTermValue { get; set; } @@ -1775,7 +1769,7 @@ public MultisearchBodyDescriptor ScriptFields(Func? searchAfter) + public MultisearchBodyDescriptor SearchAfter(IEnumerable? searchAfter) { SearchAfterValue = searchAfter; return Self; @@ -1811,18 +1805,6 @@ public MultisearchBodyDescriptor StoredFields(Elastic.Clients.Elasticsearch.Fiel return Self; } - public MultisearchBodyDescriptor StoredFields(Expression> storedFields) - { - StoredFieldsValue = storedFields; - return Self; - } - - public MultisearchBodyDescriptor StoredFields(Expression> storedFields) - { - StoredFieldsValue = storedFields; - return Self; - } - public MultisearchBodyDescriptor Suggest(Elastic.Clients.Elasticsearch.Suggester? suggest) { SuggestDescriptor = null; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeAttributes.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeAttributes.g.cs index e6f27b68716..df6d01a1f1a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeAttributes.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/NodeAttributes.g.cs @@ -34,6 +34,10 @@ public sealed partial class NodeAttributes [JsonPropertyName("ephemeral_id")] public string EphemeralId { get; init; } + [JsonInclude] + [JsonPropertyName("external_id")] + public string ExternalId { get; init; } + [JsonInclude] [JsonPropertyName("id")] public string? Id { get; init; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Operation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Operation.g.cs index 3020c143140..0e7c3043c7b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Operation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Operation.g.cs @@ -106,18 +106,6 @@ public OperationDescriptor StoredFields(Elastic.Clients.Elasticsearch.Fields? st return Self; } - public OperationDescriptor StoredFields(Expression> storedFields) - { - StoredFieldsValue = storedFields; - return Self; - } - - public OperationDescriptor StoredFields(Expression> storedFields) - { - StoredFieldsValue = storedFields; - return Self; - } - public OperationDescriptor Version(long? version) { VersionValue = version; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MultiMatchQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MultiMatchQuery.g.cs index 1e7ded45119..e1f465b8a76 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MultiMatchQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/MultiMatchQuery.g.cs @@ -172,12 +172,6 @@ public MultiMatchQueryDescriptor Fields(Elastic.Clients.Elasticsearch return Self; } - public MultiMatchQueryDescriptor Fields(Expression> fields) - { - FieldsValue = fields; - return Self; - } - public MultiMatchQueryDescriptor Fuzziness(Elastic.Clients.Elasticsearch.Fuzziness? fuzziness) { FuzzinessValue = fuzziness; @@ -440,18 +434,6 @@ public MultiMatchQueryDescriptor Fields(Elastic.Clients.Elasticsearch.Fields? fi return Self; } - public MultiMatchQueryDescriptor Fields(Expression> fields) - { - FieldsValue = fields; - return Self; - } - - public MultiMatchQueryDescriptor Fields(Expression> fields) - { - FieldsValue = fields; - return Self; - } - public MultiMatchQueryDescriptor Fuzziness(Elastic.Clients.Elasticsearch.Fuzziness? fuzziness) { FuzzinessValue = fuzziness; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermQuery.g.cs index 974468ff477..a3262d28172 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermQuery.g.cs @@ -59,7 +59,7 @@ public override TermQuery Read(ref Utf8JsonReader reader, Type typeToConvert, Js if (property == "value") { - variant.Value = JsonSerializer.Deserialize(ref reader, options); + variant.Value = JsonSerializer.Deserialize(ref reader, options); continue; } } @@ -123,7 +123,7 @@ public TermQuery(Field field) public bool? CaseInsensitive { get; set; } - public object Value { get; set; } + public Elastic.Clients.Elasticsearch.FieldValue Value { get; set; } public Elastic.Clients.Elasticsearch.Field Field { get; set; } } @@ -157,7 +157,7 @@ public TermQueryDescriptor(Expression> field) private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } - private object ValueValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue ValueValue { get; set; } public TermQueryDescriptor QueryName(string? queryName) { @@ -189,7 +189,7 @@ public TermQueryDescriptor Field(Expression Value(object value) + public TermQueryDescriptor Value(Elastic.Clients.Elasticsearch.FieldValue value) { ValueValue = value; return Self; @@ -249,7 +249,7 @@ public TermQueryDescriptor(Field field) private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } - private object ValueValue { get; set; } + private Elastic.Clients.Elasticsearch.FieldValue ValueValue { get; set; } public TermQueryDescriptor QueryName(string? queryName) { @@ -287,7 +287,7 @@ public TermQueryDescriptor Field(Expression> return Self; } - public TermQueryDescriptor Value(object value) + public TermQueryDescriptor Value(Elastic.Clients.Elasticsearch.FieldValue value) { ValueValue = value; return Self; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQueryField.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQueryField.g.cs index a41c301c231..24d6e185792 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQueryField.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/TermsQueryField.g.cs @@ -25,9 +25,9 @@ #nullable restore namespace Elastic.Clients.Elasticsearch.QueryDsl { - public partial class TermsQueryField : Union, Elastic.Clients.Elasticsearch.QueryDsl.TermsLookup> + public partial class TermsQueryField : Union, Elastic.Clients.Elasticsearch.QueryDsl.TermsLookup> { - public TermsQueryField(IReadOnlyCollection termsQueryField) : base(termsQueryField) + public TermsQueryField(IReadOnlyCollection termsQueryField) : base(termsQueryField) { } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SlicedScroll.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SlicedScroll.g.cs index c78a4503b61..07b7d517e80 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SlicedScroll.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SlicedScroll.g.cs @@ -32,7 +32,7 @@ public sealed partial class SlicedScroll [JsonInclude] [JsonPropertyName("id")] - public int Id { get; set; } + public Elastic.Clients.Elasticsearch.Id Id { get; set; } [JsonInclude] [JsonPropertyName("max")] @@ -48,7 +48,7 @@ public SlicedScrollDescriptor() : base() private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } - private int IdValue { get; set; } + private Elastic.Clients.Elasticsearch.Id IdValue { get; set; } private int MaxValue { get; set; } @@ -64,7 +64,7 @@ public SlicedScrollDescriptor Field(Expression Id(int id) + public SlicedScrollDescriptor Id(Elastic.Clients.Elasticsearch.Id id) { IdValue = id; return Self; @@ -86,7 +86,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o } writer.WritePropertyName("id"); - writer.WriteNumberValue(IdValue); + JsonSerializer.Serialize(writer, IdValue, options); writer.WritePropertyName("max"); writer.WriteNumberValue(MaxValue); writer.WriteEndObject(); @@ -102,7 +102,7 @@ public SlicedScrollDescriptor() : base() private Elastic.Clients.Elasticsearch.Field? FieldValue { get; set; } - private int IdValue { get; set; } + private Elastic.Clients.Elasticsearch.Id IdValue { get; set; } private int MaxValue { get; set; } @@ -124,7 +124,7 @@ public SlicedScrollDescriptor Field(Expression SourceFields(Elastic.Clients.Elasticsearch.Fi return Self; } - public SourceDescriptor SourceFields(Expression> sourceFields) - { - SourceFieldsValue = sourceFields; - return Self; - } - public SourceDescriptor Index(Elastic.Clients.Elasticsearch.Indices index) { IndexValue = index; @@ -373,18 +367,6 @@ public SourceDescriptor SourceFields(Elastic.Clients.Elasticsearch.Fields? sourc return Self; } - public SourceDescriptor SourceFields(Expression> sourceFields) - { - SourceFieldsValue = sourceFields; - return Self; - } - - public SourceDescriptor SourceFields(Expression> sourceFields) - { - SourceFieldsValue = sourceFields; - return Self; - } - public SourceDescriptor Index(Elastic.Clients.Elasticsearch.Indices index) { IndexValue = index; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SourceFilter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SourceFilter.g.cs index 01ae4133220..9146ec4bbf8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SourceFilter.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SourceFilter.g.cs @@ -97,36 +97,12 @@ public SourceFilterDescriptor Excludes(Elastic.Clients.Elasticsearch.Fields? exc return Self; } - public SourceFilterDescriptor Excludes(Expression> excludes) - { - ExcludesValue = excludes; - return Self; - } - - public SourceFilterDescriptor Excludes(Expression> excludes) - { - ExcludesValue = excludes; - return Self; - } - public SourceFilterDescriptor Includes(Elastic.Clients.Elasticsearch.Fields? includes) { IncludesValue = includes; return Self; } - public SourceFilterDescriptor Includes(Expression> includes) - { - IncludesValue = includes; - return Self; - } - - public SourceFilterDescriptor Includes(Expression> includes) - { - IncludesValue = includes; - return Self; - } - protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) { writer.WriteStartObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/ParentTaskInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/ParentTaskInfo.g.cs index 6c77ccf6d2a..688e40569b7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/ParentTaskInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/ParentTaskInfo.g.cs @@ -34,6 +34,10 @@ public sealed partial class ParentTaskInfo [JsonPropertyName("cancellable")] public bool Cancellable { get; init; } + [JsonInclude] + [JsonPropertyName("cancelled")] + public bool? Cancelled { get; init; } + [JsonInclude] [JsonPropertyName("children")] public IReadOnlyCollection? Children { get; init; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/TaskInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/TaskInfo.g.cs index 88e948f1d15..9e979971e63 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/TaskInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Tasks/TaskInfo.g.cs @@ -34,6 +34,10 @@ public sealed partial class TaskInfo [JsonPropertyName("cancellable")] public bool Cancellable { get; init; } + [JsonInclude] + [JsonPropertyName("cancelled")] + public bool? Cancelled { get; init; } + [JsonInclude] [JsonPropertyName("description")] public string? Description { get; init; } diff --git a/src/PlaygroundV7x/PlaygroundV7x.csproj b/src/PlaygroundV7x/PlaygroundV7x.csproj index bcff78e527a..41be1f2375c 100644 --- a/src/PlaygroundV7x/PlaygroundV7x.csproj +++ b/src/PlaygroundV7x/PlaygroundV7x.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/PlaygroundV7x/Program.cs b/src/PlaygroundV7x/Program.cs index 78d37c4a95c..78e812b6bfe 100644 --- a/src/PlaygroundV7x/Program.cs +++ b/src/PlaygroundV7x/Program.cs @@ -12,198 +12,253 @@ namespace PlaygroundV7x { internal class Program { - private static async Task Main() - { - - + private static readonly IElasticClient Client = + new ElasticClient(new ConnectionSettings(new InMemoryConnection(Array.Empty(), 502, null, null)) + .DefaultIndex("index") + .EnableHttpCompression(false) + ); + private static void Main() + { + var things = new List() { "a" }; + + var bulkAll = Client.BulkAll(things, r => r + .BackOffRetries(0) // Number of document retries. Can set this to zero to never retry + .BackOffTime("30s") // Time to wait between retries + .RetryDocumentPredicate((bulkResponseItem, logEntry) => false) // Decide if a document should be retried in the event of a failure. + // The default behaviour is to retry only if bulkResponseItem.Status == 429. + // This can be overridden by providing a more specific delegate, or opting to never retry failed operations. + .ContinueAfterDroppedDocuments() // Continue indexing remaining items from the IEnumerable of documents even after some are dropped. + .DroppedDocumentCallback((bulkResponseItem, logEntry) => // If a document cannot be indexed this delegate is called + { + Console.WriteLine($"{bulkResponseItem.Status} : {bulkResponseItem.Error.Reason}"); // Access operation failure information for the document + }) + .MaxDegreeOfParallelism(4) + .Size(1000)); - var aggs = new AggregationDictionary + try { - { "startDates", new TermsAggregation("startDates") { Field = "startedOn" } }, - { "endDates", new DateHistogramAggregation("endDates") { Field = "endedOn" } } - }; - - var a = new SearchRequest() + bulkAll.Wait(TimeSpan.FromMinutes(10), r => Console.WriteLine("Data indexed")); + } + catch (ElasticsearchClientException ex) when (ex.Response is not null) { - From = 10, - Size = 20, - Query = new QueryContainer(new MatchAllQuery()), - Aggregations = aggs, - PostFilter = new QueryContainer(new TermQuery + if (ex.Response.HttpStatusCode.HasValue) { - Field = "state", - Value = "Stable" - }) - }; - - var client = new ElasticClient(new ConnectionSettings(new InMemoryConnection()) - .DefaultIndex("default-index") - //.DefaultMappingFor(m => m - //.DisableIdInference() - //.IndexName("people")) - //.IdProperty(id => id.SecondaryId) - //.RoutingProperty(id => id.SecondaryId) - //.RelationName("relation")) - //.DefaultFieldNameInferrer(s => $"{s}_2") - .EnableDebugMode()); - - - var createIndexResponse = await client.Indices.CreateAsync("aa", i => i - .Map(m => m.Properties(p => p.Boolean(b => b)))); - - - - var filterResponse = await client.SearchAsync(s => s - .Query(q => q - .Bool(b => b - .Filter( - f => f.Term(t => t.Field(f => f.Age).Value(37)), - f => f.Term(t => t.Field(f => f.FirstName).Value("Steve")) - )))); - - var person = new Person { Id = 101, FirstName = "Steve", LastName = "Gordon", Age = 37, Email = "sgordon@example.com" }; - - var routingResponse = await client.IndexAsync(person, r => r); - - client.Update("a", d => d.Index("test").Script(s => s.Source("script").Params(new Dictionary { { "null", new Person { FirstName = null, LastName = "test-surname" } } }))); + HandleStatusCode(ex.Response.HttpStatusCode); + } + else if (ex.Response.OriginalException is ElasticsearchClientException esException && esException.FailureReason == PipelineFailure.FailedProductCheck) + { + HandleStatusCode(esException.Response?.HttpStatusCode); + } + } - var people = new List() + static void HandleStatusCode(int? statusCode) { - new Person{ FirstName = "Steve", LastName = "Gordon"}, - new Person{ FirstName = "Steve", LastName = "Gordon"}, - new Person{ FirstName = "Steve", LastName = "Gordon"}, - new Person{ FirstName = "Steve", LastName = "Gordon"}, - new Person{ FirstName = "Steve", LastName = "Gordon"}, - }; - - //using var bulk = client.BulkAll(people, r => r.Index("testing-v7")); - //var result = bulk.Wait(TimeSpan.FromSeconds(60), a => { Console.WriteLine(a.Items.Count); }); - //var a1 = result.TotalNumberOfRetries; - //var b1 = result.TotalNumberOfFailedBuffers; - - using var bulk2 = client.BulkAll(people, r => r); - var result2 = bulk2.Wait(TimeSpan.FromSeconds(60), a => { Console.WriteLine(a.Items.Count); }); - var a12 = result2.TotalNumberOfRetries; - var b12 = result2.TotalNumberOfFailedBuffers; - - //var responseBulk = client.Bulk(new BulkRequest - //{ - // Operations = new List - //{ - // new BulkIndexOperation(new Person()) { Index = "people" } , - // new BulkIndexOperation(new Person()) { Index = "people", IfSequenceNumber = -1, IfPrimaryTerm = 0 } - //} - //}); - - var response = client.Index(new Person(), e => e.Index("test")); - - var settingsResponse = await client.Indices.CreateAsync("a", i => i.Settings(s => s.Analysis(a => a.TokenFilters(tf => tf - .Shingle("my-shingle", s => s.MinShingleSize(2)) - .Snowball("my_snowball", s => s.Version("v1")))))); - - //var c1 = new ElasticClient(new ConnectionSettings(new Uri("https://azure.es.eastus.azure.elastic-cloud.com:9243")).BasicAuthentication("a", "b").ThrowExceptions()); - - //var r1 = await c1.PingAsync(); - + if (statusCode.HasValue) + { + switch (statusCode.Value) + { + case 404: + Console.WriteLine("404"); // handle as required + break; + case 410: + Console.WriteLine("410"); + break; + // etc. + } + } + } -#pragma warning disable IDE0039 // Use local function - Func, IBoolQuery> test = b => b.Name("thing"); -#pragma warning restore IDE0039 // Use local function - static IBoolQuery TestBoolQuery(BoolQueryDescriptor b) => b.Name("thing"); - var thing = Query.Bool(test); - thing = Query.Bool(TestBoolQuery); +// var aggs = new AggregationDictionary +// { +// { "startDates", new TermsAggregation("startDates") { Field = "startedOn" } }, +// { "endDates", new DateHistogramAggregation("endDates") { Field = "endedOn" } } +// }; - var matchQueryOne = Query.Match(m => m.Field(f => f.FirstName).Query("Steve")); - var matchQueryTwo = new QueryContainer(new MatchQuery() { Field = Infer.Field(f => f.FirstName), Query = "Steve" }); - var matchQueryThree = new QueryContainerDescriptor().Match(m => m.Field(f => f.FirstName).Query("Steve")); +// var a = new SearchRequest() +// { +// From = 10, +// Size = 20, +// Query = new QueryContainer(new MatchAllQuery()), +// Aggregations = aggs, +// PostFilter = new QueryContainer(new TermQuery +// { +// Field = "state", +// Value = "Stable" +// }) +// }; +// var client = new ElasticClient(new ConnectionSettings(new InMemoryConnection()) +// .DefaultIndex("default-index") +// //.DefaultMappingFor(m => m +// //.DisableIdInference() +// //.IndexName("people")) +// //.IdProperty(id => id.SecondaryId) +// //.RoutingProperty(id => id.SecondaryId) +// //.RelationName("relation")) +// //.DefaultFieldNameInferrer(s => $"{s}_2") +// .EnableDebugMode()); - //var a = client.IndexMany(new Person[0] { }, a => a.) - var matchAll = new QueryContainer(new MatchAllQuery() { Name = "test_query", IsVerbatim = true }); - //var filter = Query.Bool(b => b.Filter(f => f.Match(m => m.Field(fld => fld.FirstName).Query("Steve").Name("test_match")))); - var boolQuery = new QueryContainer(new BoolQuery() { Filter = new[] { new QueryContainer(new MatchQuery() { Name = "test_match", Field = "firstName", Query = "Steve" }) } }); +// var createIndexResponse = await client.Indices.CreateAsync("aa", i => i +// .Map(m => m.Properties(p => p.Boolean(b => b)))); - var spanQuery = new QueryContainer(new SpanContainingQuery() - { - Big = new SpanQuery() - { - //SpanTerm = new SpanTermQuery { Field = "test", Value = "foo", Name = "span_term_name" }, - SpanNear = new SpanNearQuery - { - Slop = 5, - InOrder = true, - Clauses = new ISpanQuery[] - { - new SpanQuery() { SpanTerm = new SpanTermQuery { Field = "test", Value = "bar", Name = "span_term_inner_name_1" } }, - new SpanQuery() { SpanTerm = new SpanTermQuery { Field = "test", Value = "baz", Name = "span_term_inner_name_2" } }, - } - } - } - }); - spanQuery = new QueryContainer(new SpanNearQuery() - { - Clauses = new[] { new SpanQuery() { SpanGap = new SpanGapQuery() { Field = "test", Width = 10 } } } - }); - //var spanQueryRaw = new SpanQuery() - //{ - // SpanFirst = new SpanFirstQuery(), - // SpanContaining = new SpanContainingQuery() - //}; +// var filterResponse = await client.SearchAsync(s => s +// .Query(q => q +// .Bool(b => b +// .Filter( +// f => f.Term(t => t.Field(f => f.Age).Value(37)), +// f => f.Term(t => t.Field(f => f.FirstName).Value("Steve")) +// )))); + +// var person = new Person { Id = 101, FirstName = "Steve", LastName = "Gordon", Age = 37, Email = "sgordon@example.com" }; + +// var routingResponse = await client.IndexAsync(person, r => r); + +// client.Update("a", d => d.Index("test").Script(s => s.Source("script").Params(new Dictionary { { "null", new Person { FirstName = null, LastName = "test-surname" } } }))); + +// var people = new List() +// { +// new Person{ FirstName = "Steve", LastName = "Gordon"}, +// new Person{ FirstName = "Steve", LastName = "Gordon"}, +// new Person{ FirstName = "Steve", LastName = "Gordon"}, +// new Person{ FirstName = "Steve", LastName = "Gordon"}, +// new Person{ FirstName = "Steve", LastName = "Gordon"}, +// }; - var search = new SearchRequest() - { - Query = spanQuery - }; - - _ = await client.SearchAsync(new SearchDescriptor()); - _ = await client.CountAsync(new CountDescriptor()); - - //var response = await client.SearchAsync(search); - - var r = await client.Indices.CreateAsync("", c => c.Settings(s => s.Analysis(a => a.CharFilters(cf => cf - .HtmlStrip("name", h => h) - .PatternReplace("name-2", p => p))))); - - //var indexName = Guid.NewGuid().ToString(); - - //// Create an index - //var createResponse = await client.Indices.CreateAsync(new CreateIndexRequest(indexName) - //{ - // Mappings = new TypeMapping - // { - // DateDetection = false, - // Properties = new Properties - // { - // {"age", new NumberProperty(NumberType.Integer)}, - // {"name", new TextProperty()}, - // {"email", new KeywordProperty()} - // }, - // Meta = new Dictionary() - // { - // { "foo", "bar" } - // } - // } - //}); - - //var intervalsQuery = new IntervalsQuery() - //{ - // Match = new IntervalsMatch() - // { - - // }, - // AllOf = new IntervalsAllOf() - // { - - // } - //} +// //using var bulk = client.BulkAll(people, r => r.Index("testing-v7")); +// //var result = bulk.Wait(TimeSpan.FromSeconds(60), a => { Console.WriteLine(a.Items.Count); }); +// //var a1 = result.TotalNumberOfRetries; +// //var b1 = result.TotalNumberOfFailedBuffers; + +// using var bulk2 = client.BulkAll(people, r => r); +// var result2 = bulk2.Wait(TimeSpan.FromSeconds(60), a => { Console.WriteLine(a.Items.Count); }); +// var a12 = result2.TotalNumberOfRetries; +// var b12 = result2.TotalNumberOfFailedBuffers; + +// //var responseBulk = client.Bulk(new BulkRequest +// //{ +// // Operations = new List +// //{ +// // new BulkIndexOperation(new Person()) { Index = "people" } , +// // new BulkIndexOperation(new Person()) { Index = "people", IfSequenceNumber = -1, IfPrimaryTerm = 0 } +// //} +// //}); + +// var response = client.Index(new Person(), e => e.Index("test")); + +// var settingsResponse = await client.Indices.CreateAsync("a", i => i.Settings(s => s.Analysis(a => a.TokenFilters(tf => tf +// .Shingle("my-shingle", s => s.MinShingleSize(2)) +// .Snowball("my_snowball", s => s.Version("v1")))))); + +// //var c1 = new ElasticClient(new ConnectionSettings(new Uri("https://azure.es.eastus.azure.elastic-cloud.com:9243")).BasicAuthentication("a", "b").ThrowExceptions()); + +// //var r1 = await c1.PingAsync(); + + + + +//#pragma warning disable IDE0039 // Use local function +// Func, IBoolQuery> test = b => b.Name("thing"); +//#pragma warning restore IDE0039 // Use local function + +// static IBoolQuery TestBoolQuery(BoolQueryDescriptor b) => b.Name("thing"); + +// var thing = Query.Bool(test); +// thing = Query.Bool(TestBoolQuery); + +// var matchQueryOne = Query.Match(m => m.Field(f => f.FirstName).Query("Steve")); +// var matchQueryTwo = new QueryContainer(new MatchQuery() { Field = Infer.Field(f => f.FirstName), Query = "Steve" }); +// var matchQueryThree = new QueryContainerDescriptor().Match(m => m.Field(f => f.FirstName).Query("Steve")); + + +// //var a = client.IndexMany(new Person[0] { }, a => a.) + +// var matchAll = new QueryContainer(new MatchAllQuery() { Name = "test_query", IsVerbatim = true }); +// //var filter = Query.Bool(b => b.Filter(f => f.Match(m => m.Field(fld => fld.FirstName).Query("Steve").Name("test_match")))); +// var boolQuery = new QueryContainer(new BoolQuery() { Filter = new[] { new QueryContainer(new MatchQuery() { Name = "test_match", Field = "firstName", Query = "Steve" }) } }); + +// var spanQuery = new QueryContainer(new SpanContainingQuery() +// { +// Big = new SpanQuery() +// { +// //SpanTerm = new SpanTermQuery { Field = "test", Value = "foo", Name = "span_term_name" }, +// SpanNear = new SpanNearQuery +// { +// Slop = 5, +// InOrder = true, +// Clauses = new ISpanQuery[] +// { +// new SpanQuery() { SpanTerm = new SpanTermQuery { Field = "test", Value = "bar", Name = "span_term_inner_name_1" } }, +// new SpanQuery() { SpanTerm = new SpanTermQuery { Field = "test", Value = "baz", Name = "span_term_inner_name_2" } }, +// } +// } +// } +// }); + +// spanQuery = new QueryContainer(new SpanNearQuery() +// { +// Clauses = new[] { new SpanQuery() { SpanGap = new SpanGapQuery() { Field = "test", Width = 10 } } } +// }); + +// //var spanQueryRaw = new SpanQuery() +// //{ +// // SpanFirst = new SpanFirstQuery(), +// // SpanContaining = new SpanContainingQuery() +// //}; + +// var search = new SearchRequest() +// { +// Query = spanQuery +// }; + +// _ = await client.SearchAsync(new SearchDescriptor()); +// _ = await client.CountAsync(new CountDescriptor()); + +// //var response = await client.SearchAsync(search); + +// var r = await client.Indices.CreateAsync("", c => c.Settings(s => s.Analysis(a => a.CharFilters(cf => cf +// .HtmlStrip("name", h => h) +// .PatternReplace("name-2", p => p))))); + +// //var indexName = Guid.NewGuid().ToString(); + +// //// Create an index +// //var createResponse = await client.Indices.CreateAsync(new CreateIndexRequest(indexName) +// //{ +// // Mappings = new TypeMapping +// // { +// // DateDetection = false, +// // Properties = new Properties +// // { +// // {"age", new NumberProperty(NumberType.Integer)}, +// // {"name", new TextProperty()}, +// // {"email", new KeywordProperty()} +// // }, +// // Meta = new Dictionary() +// // { +// // { "foo", "bar" } +// // } +// // } +// //}); + +// //var intervalsQuery = new IntervalsQuery() +// //{ +// // Match = new IntervalsMatch() +// // { + +// // }, +// // AllOf = new IntervalsAllOf() +// // { + +// // } +// //} } } } diff --git a/src/PlaygroundV7x/packages.lock.json b/src/PlaygroundV7x/packages.lock.json index 7007e135e67..b98577951a6 100644 --- a/src/PlaygroundV7x/packages.lock.json +++ b/src/PlaygroundV7x/packages.lock.json @@ -25,17 +25,17 @@ }, "NEST": { "type": "Direct", - "requested": "[7.13.0, )", - "resolved": "7.13.0", - "contentHash": "Hoi1/slRx4RK3VfDF5yhkpazH+pJhFlqZ6eY4cjhJUBNRL1TCQo9isD1eTQJzYt5u0xO3cxOnpgd9A380USO8Q==", + "requested": "[7.17.4, )", + "resolved": "7.17.4", + "contentHash": "FFz357NTG4P+4cnclVZ4I7bpZp0oNYZ3Dk88IzZ2NEttaxzFSI7+C7yF93y9Jg5myNwiStI+/tppwNut8M85Lw==", "dependencies": { - "Elasticsearch.Net": "7.13.0" + "Elasticsearch.Net": "7.17.4" } }, "Elasticsearch.Net": { "type": "Transitive", - "resolved": "7.13.0", - "contentHash": "OyH1XWcUzMgs/L4QVu57XYYeeEfwixGsI6mSqXxPylKynBtDzUkSY7HoGjvIh8tS9MkEIf3P0/8aCMz9Yz9rJA==", + "resolved": "7.17.4", + "contentHash": "5SIkngYAzsHhLLaj9fSmoTAZXARkKLUbvSzSdtZiNRdDxVPQjJgCT2q1FaSyTqRsWhh5zS5yhUUTL/CIKv2irA==", "dependencies": { "Microsoft.CSharp": "4.6.0", "System.Buffers": "4.5.1", diff --git a/tests/Tests.Configuration/tests.default.yaml b/tests/Tests.Configuration/tests.default.yaml index 1731177cc55..70678851cbe 100644 --- a/tests/Tests.Configuration/tests.default.yaml +++ b/tests/Tests.Configuration/tests.default.yaml @@ -5,7 +5,7 @@ # tracked by git). # mode either u (unit test), i (integration test) or m (mixed mode) -mode: i +mode: u # the elasticsearch version that should be started # Can be a snapshot version of sonatype or "latest" to get the latest snapshot of sonatype elasticsearch_version: 8.4.2 diff --git a/tests/Tests/Aggregations/Bucket/TermsAggregationUsageTests.cs b/tests/Tests/Aggregations/Bucket/TermsAggregationUsageTests.cs index b1c4b221d63..a92fe8ba501 100644 --- a/tests/Tests/Aggregations/Bucket/TermsAggregationUsageTests.cs +++ b/tests/Tests/Aggregations/Bucket/TermsAggregationUsageTests.cs @@ -34,7 +34,7 @@ public TermsAggregationUsageTests(ReadOnlyCluster i, EndpointUsage usage) : base size = 5, shard_size = 100, execution_hint = "map", - //missing = "n/a", + missing = "n/a", script = new { source = "'State of Being: '+_value", @@ -55,7 +55,7 @@ public TermsAggregationUsageTests(ReadOnlyCluster i, EndpointUsage usage) : base .Size(5) .ShardSize(100) .ExecutionHint(TermsAggregationExecutionHint.Map) - //.Missing("n/a") + .Missing("n/a") .Script(new Script(new InlineScript("'State of Being: '+_value"))) .Order(new[] { @@ -75,7 +75,7 @@ public TermsAggregationUsageTests(ReadOnlyCluster i, EndpointUsage usage) : base Size = 5, ShardSize = 100, ExecutionHint = TermsAggregationExecutionHint.Map, - //Missing = "n/a", + Missing = "n/a", Script = new Script(new InlineScript("'State of Being: '+_value")), Order = new [] { @@ -102,7 +102,7 @@ protected override void ExpectResponse(SearchResponse response) bucketsCollection.Count.Should().BeGreaterThan(0); foreach (var item in bucketsCollection) { - item.Key.Should().NotBeNullOrEmpty(); + item.Key.ToString().Should().NotBeNullOrEmpty(); item.DocCount.Should().BeGreaterOrEqualTo(1); } states.Meta.Should().NotBeNull().And.HaveCount(1); diff --git a/tests/Tests/Aggregations/Metric/AverageAggregationUsageTests.cs b/tests/Tests/Aggregations/Metric/AverageAggregationUsageTests.cs index 243962a2fef..60f340908ce 100644 --- a/tests/Tests/Aggregations/Metric/AverageAggregationUsageTests.cs +++ b/tests/Tests/Aggregations/Metric/AverageAggregationUsageTests.cs @@ -28,7 +28,7 @@ public AverageAggregationUsageTests(ReadOnlyCluster i, EndpointUsage usage) : ba avg = new { field = "numberOfCommits", - //missing = 10.0, + missing = 10.0, script = new { source = "_value * 1.2", @@ -43,8 +43,8 @@ public AverageAggregationUsageTests(ReadOnlyCluster i, EndpointUsage usage) : ba .Add("foo", "bar") ) .Field(p => p.NumberOfCommits) - //.Missing(10) - //.Script(ss => ss.Source("_value * 1.2")) + .Missing(10) + //.Script(ss => ss.Source("_value * 1.2")) // TODO: {Usability} Support this cleaner fluent syntax for scripts .Script(new Script(new InlineScript("_value * 1.2"))) ); @@ -55,7 +55,7 @@ public AverageAggregationUsageTests(ReadOnlyCluster i, EndpointUsage usage) : ba { { "foo", "bar" } }, - //Missing = 10, + Missing = 10, Script = new Script(new InlineScript("_value * 1.2")) }; diff --git a/tests/Tests/Aggregations/Metric/BoxplotAggregationUsageTests.cs b/tests/Tests/Aggregations/Metric/BoxplotAggregationUsageTests.cs index 382c5b2abe6..7b851043430 100644 --- a/tests/Tests/Aggregations/Metric/BoxplotAggregationUsageTests.cs +++ b/tests/Tests/Aggregations/Metric/BoxplotAggregationUsageTests.cs @@ -28,7 +28,7 @@ public BoxplotAggregationUsageTests(ReadOnlyCluster i, EndpointUsage usage) : ba boxplot = new { field = "numberOfCommits", - //missing = 10.0, + missing = 10.0, compression = 100.0 } } @@ -40,7 +40,7 @@ public BoxplotAggregationUsageTests(ReadOnlyCluster i, EndpointUsage usage) : ba .Add("foo", "bar") ) .Field(p => p.NumberOfCommits) - //.Missing(10) + .Missing(10) .Compression(100) ); @@ -51,7 +51,7 @@ public BoxplotAggregationUsageTests(ReadOnlyCluster i, EndpointUsage usage) : ba { { "foo", "bar" } }, - //Missing = 10, + Missing = 10, Compression = 100 }; diff --git a/tests/Tests/AsyncSearch/AsyncSearchApiTests.cs b/tests/Tests/AsyncSearch/AsyncSearchApiTests.cs index 98b4c5752c5..cd2a5513c0e 100644 --- a/tests/Tests/AsyncSearch/AsyncSearchApiTests.cs +++ b/tests/Tests/AsyncSearch/AsyncSearchApiTests.cs @@ -13,6 +13,7 @@ using Tests.Framework.EndpointTests; using Tests.Framework.EndpointTests.TestState; using System; +using Elastic.Clients.Elasticsearch.Experimental; namespace Tests.AsyncSearch; @@ -40,7 +41,7 @@ public AsyncSearchApiTests(ReadOnlyCluster cluster, EndpointUsage usage) : base( Size = 5, ShardSize = 100, ExecutionHint = TermsAggregationExecutionHint.Map, - //Missing = "n/a", + Missing = "n/a", // TODO - Review terms agg and fix this //Include = new TermsInclude(new[] { StateOfBeing.Stable.ToString(), StateOfBeing.VeryActive.ToString() }), Order =new [] @@ -62,7 +63,7 @@ public AsyncSearchApiTests(ReadOnlyCluster cluster, EndpointUsage usage) : base( .Size(5) .ShardSize(100) .ExecutionHint(TermsAggregationExecutionHint.Map) - //.Missing("n/a") + .Missing("n/a") // TODO - Review terms agg and fix this //.Include(new[] { StateOfBeing.Stable.ToString(), StateOfBeing.VeryActive.ToString() }) .Order(new [] @@ -159,6 +160,9 @@ public async Task AsyncSearchGetResponse() => await Assert(json); + obj.FieldValue.TryGetLazyDocument(out var value).Should().BeTrue(); + var anotherClass = value.Value.As(); + anotherClass.Should().NotBeNull(); + anotherClass.Thing.Should().Be("value"); + } + + private class TestClass + { + public FieldValue FieldValue { get; set; } + } + + private class AnotherClass + { + public string Thing { get; set; } + } +} diff --git a/tests/Tests/Document/Multiple/DeleteByQuery/DeleteByQueryApiTests.cs b/tests/Tests/Document/Multiple/DeleteByQuery/DeleteByQueryApiTests.cs index 32840de025e..c74c09ddffe 100644 --- a/tests/Tests/Document/Multiple/DeleteByQuery/DeleteByQueryApiTests.cs +++ b/tests/Tests/Document/Multiple/DeleteByQuery/DeleteByQueryApiTests.cs @@ -264,7 +264,8 @@ public DeleteByQueryWithSlicesApiTests(IntrusiveOperationCluster cluster, Endpoi }; protected override string ExpectedUrlPathAndQuery => $"/{CallIsolatedValue}/_delete_by_query"; - private static List FirstTenProjectNames => Project.Projects.Take(10).Select(p => p.Name).ToList(); + + private static List FirstTenProjectNames => Project.Projects.Take(10).Select(p => FieldValue.String(p.Name)).ToList(); protected override DeleteByQueryRequestDescriptor NewDescriptor() => new(CallIsolatedValue); diff --git a/tests/Tests/Document/Multiple/DeleteByQueryRethrottle/DeleteByQueryRethrottleApiTests.cs b/tests/Tests/Document/Multiple/DeleteByQueryRethrottle/DeleteByQueryRethrottleApiTests.cs index 5a99118e3c5..a487d208716 100644 --- a/tests/Tests/Document/Multiple/DeleteByQueryRethrottle/DeleteByQueryRethrottleApiTests.cs +++ b/tests/Tests/Document/Multiple/DeleteByQueryRethrottle/DeleteByQueryRethrottleApiTests.cs @@ -41,7 +41,7 @@ public DeleteByQueryRethrottleApiTests(ReindexCluster cluster, EndpointUsage usa protected override bool SupportsDeserialization => false; protected TaskId TaskId => RanIntegrationSetup ? ExtendedValue(TaskIdKey) : "foo:1"; - protected override string ExpectedUrlPathAndQuery => RanIntegrationSetup ? $"/_delete_by_query/{TaskId}/_rethrottle?requests_per_second=-1" : $"/_delete_by_query/foo%3A1/_rethrottle?requests_per_second=-1"; + protected override string ExpectedUrlPathAndQuery => $"/_delete_by_query/{TaskId.NodeId}%3A{TaskId.TaskNumber}/_rethrottle?requests_per_second=-1"; protected override void IntegrationSetup(ElasticsearchClient client, CallUniqueValues values) { diff --git a/tests/Tests/Document/Multiple/DeleteByQueryRethrottle/DeleteByQueryRethrottleUrlTests.cs b/tests/Tests/Document/Multiple/DeleteByQueryRethrottle/DeleteByQueryRethrottleUrlTests.cs index 3a4ce456065..0df0e53cb8d 100644 --- a/tests/Tests/Document/Multiple/DeleteByQueryRethrottle/DeleteByQueryRethrottleUrlTests.cs +++ b/tests/Tests/Document/Multiple/DeleteByQueryRethrottle/DeleteByQueryRethrottleUrlTests.cs @@ -10,7 +10,7 @@ namespace Tests.Document.Multiple.DeleteByQueryRethrottle { public class DeleteByQueryRethrottleUrlTests : UrlTestsBase { - private readonly Id _taskId = "rhtoNesNR4aXVIY2bRR4GQ:13056"; + private readonly TaskId _taskId = "rhtoNesNR4aXVIY2bRR4GQ:13056"; [U] public override async Task Urls() => await POST($"/_delete_by_query/{EscapeUriString(_taskId.ToString())}/_rethrottle") diff --git a/tests/Tests/Search/Search/SearchApiTests.cs b/tests/Tests/Search/Search/SearchApiTests.cs index 6d19f064276..8ab242ed1d8 100644 --- a/tests/Tests/Search/Search/SearchApiTests.cs +++ b/tests/Tests/Search/Search/SearchApiTests.cs @@ -69,7 +69,7 @@ public SearchApiTests(ReadOnlyCluster cluster, EndpointUsage usage) : base(clust ) ) .PostFilter(f => f - .Term(p => p.State, StateOfBeing.Stable) // TODO - REVIEW THIS + .Term(p => p.State, StateOfBeing.Stable) ); protected override HttpMethod HttpMethod => HttpMethod.POST; diff --git a/tests/Tests/Serialization/Aggregations/ChildrenAggregateSerializationTests.cs b/tests/Tests/Serialization/Aggregations/ChildrenAggregateSerializationTests.cs index 24f702561e0..c1933e0e98d 100644 --- a/tests/Tests/Serialization/Aggregations/ChildrenAggregateSerializationTests.cs +++ b/tests/Tests/Serialization/Aggregations/ChildrenAggregateSerializationTests.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Linq; +using Elastic.Clients.Elasticsearch.Experimental; namespace Tests.Serialization; @@ -15,11 +16,19 @@ public void DeserialisesCorrectly() var searchResponse = DeserializeJsonString>(json); - var topTagsTermsAggregate = searchResponse.Aggregations.GetTerms("top-tags"); - var firstTopTagsBucket = topTagsTermsAggregate.Buckets.Single(); - var childrenAggregate = firstTopTagsBucket.GetChildren("to-answers"); + var topTagsStringTermsAggregate = searchResponse.Aggregations.GetStringTerms("top-tags"); + var firstTopTagsStringTermsBucket = topTagsStringTermsAggregate.Buckets.Single(); + var childrenAggregate = firstTopTagsStringTermsBucket.GetChildren("to-answers"); var topNamesAggregate = childrenAggregate.GetTerms("top-names"); var firstTopNameBucket = topNamesAggregate.Buckets.First(); firstTopNameBucket.Key.Should().Be("Sam"); + + // This tests the experiental GetTerms extension method as an easier way to access the same terms. + var topTagsTermsAggregate = searchResponse.Aggregations.GetTerms("top-tags"); + var firstTopTagsBucket = topTagsTermsAggregate.Buckets.Single(); + childrenAggregate = firstTopTagsBucket.GetChildren("to-answers"); + topNamesAggregate = childrenAggregate.GetTerms("top-names"); + firstTopNameBucket = topNamesAggregate.Buckets.First(); + firstTopNameBucket.Key.Should().Be("Sam"); } } diff --git a/tests/Tests/Serialization/Aggregations/TermsAggregateDeserializationTests.cs b/tests/Tests/Serialization/Aggregations/TermsAggregateDeserializationTests.cs index b2b97e92016..3ed70d873f5 100644 --- a/tests/Tests/Serialization/Aggregations/TermsAggregateDeserializationTests.cs +++ b/tests/Tests/Serialization/Aggregations/TermsAggregateDeserializationTests.cs @@ -3,7 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Linq; -using Elastic.Clients.Elasticsearch.Aggregations; +using Elastic.Clients.Elasticsearch.Experimental; namespace Tests.Serialization; @@ -28,12 +28,12 @@ public void CanDeserialize_BasicStringTermsAggregate() bucketCollection.Should().HaveCount(2); var firstBucket = bucketCollection.First(); - firstBucket.Key.Should().Be("electronic"); + firstBucket.Key.ToString().Should().Be("electronic"); firstBucket.DocCount.Should().Be(5); firstBucket.DocCountError.Should().Be(2); var secondBucket = bucketCollection.Last(); - secondBucket.Key.Should().Be("rock"); + secondBucket.Key.ToString().Should().Be("rock"); secondBucket.DocCount.Should().Be(3); secondBucket.DocCountError.Should().BeNull(); } @@ -123,16 +123,16 @@ public void CanDeserialize_StringBased_MultiTermsAggregate() var firstBucket = bucketCollection.First(); firstBucket.Key.Should().HaveCount(2); - firstBucket.Key.First().Should().BeOfType().Subject.Should().Be("key-1"); - firstBucket.Key.Last().Should().BeOfType().Subject.Should().Be("key-2"); + firstBucket.Key.First().Should().BeOfType().Subject.ToString().Should().Be("key-1"); + firstBucket.Key.Last().Should().BeOfType().Subject.ToString().Should().Be("key-2"); firstBucket.KeyAsString.Should().Be("key-1|key-2"); firstBucket.DocCount.Should().Be(5); firstBucket.DocCountErrorUpperBound.Should().Be(2); var secondBucket = bucketCollection.Last(); secondBucket.Key.Should().HaveCount(2); - secondBucket.Key.First().Should().BeOfType().Subject.Should().Be("key-3"); - secondBucket.Key.Last().Should().BeOfType().Subject.Should().Be("key-4"); + secondBucket.Key.First().Should().BeOfType().Subject.ToString().Should().Be("key-3"); + secondBucket.Key.Last().Should().BeOfType().Subject.ToString().Should().Be("key-4"); secondBucket.KeyAsString.Should().Be("key-3|key-4"); secondBucket.DocCount.Should().Be(3); secondBucket.DocCountErrorUpperBound.Should().BeNull(); @@ -172,36 +172,31 @@ public void CanDeserialize_BasicDoubleTerms_AndAccessAsTermsAggregate() } [U] - public void CanDeserialize_BasicEmptyTermsAggregate() + public void CanDeserialize_TermsAggregate_WithSubAggregation() { - var stream = WrapInStream(@"{""aggregations"":{""terms#my-agg-name"":{""doc_count_error_upper_bound"":10,""sum_other_doc_count"":200,""buckets"":[]}}}"); - - var search = _requestResponseSerializer.Deserialize(stream); - - search.Aggregations.Should().HaveCount(1); + var json = @"{""aggregations"":{""terms#my-agg-name"":{""doc_count_error_upper_bound"":0,""sum_other_doc_count"":0,""buckets"":[{""key"":""foo"",""doc_count"":5,""avg#my-sub-agg-name"":{""value"":75.0}}]}}}"; - var isEmpty = search.Aggregations.IsEmptyTerms("my-agg-name"); + var response = DeserializeJsonString>(json); - isEmpty.Should().BeTrue(); + var stringTermsAgg = response.Aggregations.GetStringTerms("my-agg-name"); + var avgAgg = stringTermsAgg.Buckets.Single().GetAverage("my-sub-agg-name"); + avgAgg.Value.Should().Be(75.0); - if (isEmpty) - { - var agg = search.Aggregations.EmptyTerms("my-agg-name"); - agg.DocCountErrorUpperBound.Should().Be(10); - agg.SumOtherDocCount.Should().Be(200); - agg.Buckets.Item2.Should().HaveCount(0); - } + // This tests the experiental GetTerms extension method as an easier way to access the same terms. + var termsAgg = response.Aggregations.GetTerms("my-agg-name"); + avgAgg = termsAgg.Buckets.Single().GetAverage("my-sub-agg-name"); + avgAgg.Value.Should().Be(75.0); } [U] - public void CanDeserialize_TermsAggregate_WithSubAggregation() + public void CanDeserialize_StringTermsAggregate() { - var json = @"{""aggregations"":{""terms#my-agg-name"":{""doc_count_error_upper_bound"":0,""sum_other_doc_count"":0,""buckets"":[{""key"":""foo"",""doc_count"":5,""avg#my-sub-agg-name"":{""value"":75.0}}]}}}"; + var json = @"{""aggregations"":{""sterms#states"":{""meta"":{""foo"":""bar""},""doc_count_error_upper_bound"":0,""sum_other_doc_count"":0,""buckets"":[]}}}"; var response = DeserializeJsonString>(json); - var termsAgg = response.Aggregations.GetTerms("my-agg-name"); - var avgAgg = termsAgg.Buckets.Single().GetAverage("my-sub-agg-name"); - avgAgg.Value.Should().Be(75.0); + var stringTermsAgg = response.Aggregations.GetStringTerms("states"); + stringTermsAgg.Should().NotBeNull(); + stringTermsAgg.Meta.ContainsKey("foo").Should().BeTrue(); } } diff --git a/tests/Tests/Serialization/Queries/SearchSerializationTests.cs b/tests/Tests/Serialization/Queries/SearchSerializationTests.cs index fc5f7f54a28..b1233a7cda4 100644 --- a/tests/Tests/Serialization/Queries/SearchSerializationTests.cs +++ b/tests/Tests/Serialization/Queries/SearchSerializationTests.cs @@ -31,7 +31,7 @@ public async Task Search_WithTermsQuery_Serializes_ForObjectInitializer() var container = QueryContainer.Terms(new TermsQuery { Field = Infer.Field(d => d.Description), - Terms = new TermsQueryField(new object[] { "term1", "term2" }), + Terms = new TermsQueryField(new FieldValue[] { "term1", "term2" }), Boost = 1.2f }); @@ -47,7 +47,7 @@ public async Task Search_WithTermsQuery_Serializes_ForDescriptor() Terms(t => t .Boost(1.2f) .Field(f => f.Description) - .Terms(new TermsQueryField(new object[] { "term1", "term2" })))); + .Terms(new TermsQueryField(new FieldValue[] { "term1", "term2" })))); var json = SerializeAndGetJsonString(container); diff --git a/tests/Tests/Serialization/SearchResponseDeserialisationTests.cs b/tests/Tests/Serialization/SearchResponseDeserialisationTests.cs index 4e5e86a1981..f141b9f5c05 100644 --- a/tests/Tests/Serialization/SearchResponseDeserialisationTests.cs +++ b/tests/Tests/Serialization/SearchResponseDeserialisationTests.cs @@ -12,7 +12,7 @@ public class SearchResponseDeserialisationTests : SerializerTestBase [U] public void Should_HandleTsdbSortRoundTrip() { - // Sorts against a time series required changes to the sort field in the response to support `Map` as an acceptable instance. + // Sorts against a time series required changes to the sort field in the response to support a `Map` as an acceptable instance. // This test validates that we can roundtrip such values using the current model and serialiser. // See https://github.com/elastic/elasticsearch/pull/81583 @@ -23,25 +23,25 @@ public void Should_HandleTsdbSortRoundTrip() var stream = WrapInStream(json); - var search = _requestResponseSerializer.Deserialize>(stream); + var searchHit = _requestResponseSerializer.Deserialize>(stream); - search.Sort.Count.Should().Be(2); + searchHit.Sort.Count.Should().Be(2); - var roundTripExample = new SearchExample { Sort = search.Sort }; + var roundTripExample = new SearchExample { Sort = searchHit.Sort }; var serialisedJson = SerializeAndGetJsonString(roundTripExample); serialisedJson.Should().Be(@"{""sort"":[{""k8s.pod.uid"":""df3145b3-0563-4d3b-a0f7-897eb2876ea9"",""metricset"":""pod""},1619635863142]}"); var objectExample = new SearchExample { - Sort = new object[] + Sort = new FieldValue[] { - new Dictionary + FieldValue.Composite(new Dictionary { { "k8s.pod.uid", "df3145b3-0563-4d3b-a0f7-897eb2876ea9" }, { "metricset", "pod" } - }, - 1619635863142 + }), + FieldValue.Long(1619635863142) } }; @@ -56,6 +56,6 @@ private class Metric private class SearchExample { - public IReadOnlyCollection Sort { get; init; } + public IReadOnlyCollection Sort { get; init; } } } diff --git a/tests/Tests/_VerifySnapshots/FieldValueTests.CanSerialize_BoolFieldValueKind.verified.txt b/tests/Tests/_VerifySnapshots/FieldValueTests.CanSerialize_BoolFieldValueKind.verified.txt new file mode 100644 index 00000000000..e18a415c1ca --- /dev/null +++ b/tests/Tests/_VerifySnapshots/FieldValueTests.CanSerialize_BoolFieldValueKind.verified.txt @@ -0,0 +1,3 @@ +{ + fieldValue: true +} \ No newline at end of file diff --git a/tests/Tests/_VerifySnapshots/FieldValueTests.CanSerialize_DoubleFieldValueKind.verified.txt b/tests/Tests/_VerifySnapshots/FieldValueTests.CanSerialize_DoubleFieldValueKind.verified.txt new file mode 100644 index 00000000000..a34c3a27782 --- /dev/null +++ b/tests/Tests/_VerifySnapshots/FieldValueTests.CanSerialize_DoubleFieldValueKind.verified.txt @@ -0,0 +1,3 @@ +{ + fieldValue: 1.1 +} \ No newline at end of file diff --git a/tests/Tests/_VerifySnapshots/FieldValueTests.CanSerialize_LongFieldValueKind.verified.txt b/tests/Tests/_VerifySnapshots/FieldValueTests.CanSerialize_LongFieldValueKind.verified.txt new file mode 100644 index 00000000000..771365f7b45 --- /dev/null +++ b/tests/Tests/_VerifySnapshots/FieldValueTests.CanSerialize_LongFieldValueKind.verified.txt @@ -0,0 +1,3 @@ +{ + fieldValue: 1000 +} \ No newline at end of file diff --git a/tests/Tests/_VerifySnapshots/FieldValueTests.CanSerialize_NullFieldValueKind.verified.txt b/tests/Tests/_VerifySnapshots/FieldValueTests.CanSerialize_NullFieldValueKind.verified.txt new file mode 100644 index 00000000000..b299f715441 --- /dev/null +++ b/tests/Tests/_VerifySnapshots/FieldValueTests.CanSerialize_NullFieldValueKind.verified.txt @@ -0,0 +1,3 @@ +{ + fieldValue: null +} \ No newline at end of file diff --git a/tests/Tests/_VerifySnapshots/FieldValueTests.CanSerialize_StringFieldValueKind.verified.txt b/tests/Tests/_VerifySnapshots/FieldValueTests.CanSerialize_StringFieldValueKind.verified.txt new file mode 100644 index 00000000000..efbbb77de9e --- /dev/null +++ b/tests/Tests/_VerifySnapshots/FieldValueTests.CanSerialize_StringFieldValueKind.verified.txt @@ -0,0 +1,3 @@ +{ + fieldValue: test-value +} \ No newline at end of file diff --git a/tests/Tests/_VerifySnapshots/TermsAggregationUsageTests.VerifyDescriptorJson.verified.txt b/tests/Tests/_VerifySnapshots/TermsAggregationUsageTests.VerifyDescriptorJson.verified.txt index f7987bbd53c..8deea51bf5b 100644 --- a/tests/Tests/_VerifySnapshots/TermsAggregationUsageTests.VerifyDescriptorJson.verified.txt +++ b/tests/Tests/_VerifySnapshots/TermsAggregationUsageTests.VerifyDescriptorJson.verified.txt @@ -8,6 +8,7 @@ execution_hint: map, field: state, min_doc_count: 2, + missing: n/a, order: [ { _key: asc diff --git a/tests/Tests/_VerifySnapshots/TermsAggregationUsageTests.VerifyInitializerJson.verified.txt b/tests/Tests/_VerifySnapshots/TermsAggregationUsageTests.VerifyInitializerJson.verified.txt index f7987bbd53c..8deea51bf5b 100644 --- a/tests/Tests/_VerifySnapshots/TermsAggregationUsageTests.VerifyInitializerJson.verified.txt +++ b/tests/Tests/_VerifySnapshots/TermsAggregationUsageTests.VerifyInitializerJson.verified.txt @@ -8,6 +8,7 @@ execution_hint: map, field: state, min_doc_count: 2, + missing: n/a, order: [ { _key: asc