diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Api/SearchRequest.cs b/src/Elastic.Clients.Elasticsearch.Shared/Api/SearchRequest.cs index 475bd7511d..844ad157bc 100644 --- a/src/Elastic.Clients.Elasticsearch.Shared/Api/SearchRequest.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Api/SearchRequest.cs @@ -37,6 +37,17 @@ protected override (string ResolvedUrl, string UrlTemplate, Dictionary : SearchRequest +{ + public SearchRequest(Indices? indices) : base(indices) + { + } + + public SearchRequest() : base(typeof(TInferDocument)) + { + } +} + public sealed partial class SearchRequestDescriptor { public SearchRequestDescriptor Index(Indices indices) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs index d815f8c41e..d870b94b26 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs @@ -601,7 +601,7 @@ public override void Write(Utf8JsonWriter writer, SearchRequest value, JsonSeria /// Returns search hits that match the query defined in the request.
You can provide search queries using the `q` query string parameter or the request body.
If both are specified, only the query parameter is used.
/// [JsonConverter(typeof(SearchRequestConverter))] -public sealed partial class SearchRequest : PlainRequest +public partial class SearchRequest : PlainRequest { public SearchRequest() { @@ -3231,4 +3231,4 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteEndObject(); } -} \ No newline at end of file +} diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.AsyncSearch.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.AsyncSearch.g.cs index 8eae95afd3..c17b3917b2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.AsyncSearch.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.AsyncSearch.g.cs @@ -153,9 +153,9 @@ public virtual Task> GetAsync(GetAs [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] public virtual GetAsyncSearchResponse Get(Elastic.Clients.Elasticsearch.Id id) { - var descriptor = new GetAsyncSearchRequestDescriptor(id); + var descriptor = new GetAsyncSearchRequestDescriptor(id); descriptor.BeforeRequest(); - return DoRequest, GetAsyncSearchRequestParameters>(descriptor); + return DoRequest, GetAsyncSearchResponse, GetAsyncSearchRequestParameters>(descriptor); } /// @@ -163,10 +163,10 @@ public virtual GetAsyncSearchResponse Get(Elastic.Clients. /// Learn more about this API in the Elasticsearch documentation. /// [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual GetAsyncSearchResponse Get(GetAsyncSearchRequestDescriptor descriptor) + public virtual GetAsyncSearchResponse Get(GetAsyncSearchRequestDescriptor descriptor) { descriptor.BeforeRequest(); - return DoRequest, GetAsyncSearchRequestParameters>(descriptor); + return DoRequest, GetAsyncSearchResponse, GetAsyncSearchRequestParameters>(descriptor); } /// @@ -174,12 +174,12 @@ public virtual GetAsyncSearchResponse Get(GetAsyncSearchRe /// Learn more about this API in the Elasticsearch documentation. /// [Obsolete("Synchronous methods are deprecated and could be removed in the future.")] - public virtual GetAsyncSearchResponse Get(Elastic.Clients.Elasticsearch.Id id, Action configureRequest) + public virtual GetAsyncSearchResponse Get(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest) { - var descriptor = new GetAsyncSearchRequestDescriptor(id); + var descriptor = new GetAsyncSearchRequestDescriptor(id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequest, GetAsyncSearchRequestParameters>(descriptor); + return DoRequest, GetAsyncSearchResponse, GetAsyncSearchRequestParameters>(descriptor); } /// @@ -188,31 +188,31 @@ public virtual GetAsyncSearchResponse Get(Elastic.Clients. /// public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default) { - var descriptor = new GetAsyncSearchRequestDescriptor(id); + var descriptor = new GetAsyncSearchRequestDescriptor(id); descriptor.BeforeRequest(); - return DoRequestAsync, GetAsyncSearchRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, GetAsyncSearchResponse, GetAsyncSearchRequestParameters>(descriptor, cancellationToken); } /// /// Retrieves the results of a previously submitted async search request given its ID. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> GetAsync(GetAsyncSearchRequestDescriptor descriptor, CancellationToken cancellationToken = default) + public virtual Task> GetAsync(GetAsyncSearchRequestDescriptor descriptor, CancellationToken cancellationToken = default) { descriptor.BeforeRequest(); - return DoRequestAsync, GetAsyncSearchRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, GetAsyncSearchResponse, GetAsyncSearchRequestParameters>(descriptor, cancellationToken); } /// /// Retrieves the results of a previously submitted async search request given its ID. /// Learn more about this API in the Elasticsearch documentation. /// - public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.Id id, Action configureRequest, CancellationToken cancellationToken = default) + public virtual Task> GetAsync(Elastic.Clients.Elasticsearch.Id id, Action> configureRequest, CancellationToken cancellationToken = default) { - var descriptor = new GetAsyncSearchRequestDescriptor(id); + var descriptor = new GetAsyncSearchRequestDescriptor(id); configureRequest?.Invoke(descriptor); descriptor.BeforeRequest(); - return DoRequestAsync, GetAsyncSearchRequestParameters>(descriptor, cancellationToken); + return DoRequestAsync, GetAsyncSearchResponse, GetAsyncSearchRequestParameters>(descriptor, cancellationToken); } /// 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 3b55042e6a..04ea9e0168 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.g.cs @@ -85,8 +85,8 @@ public sealed partial class TermsAggregation /// Specifies the sort order of the buckets.
Defaults to sorting by descending document count.
///
[JsonInclude, JsonPropertyName("order")] - [SingleOrManyCollectionConverter(typeof(IReadOnlyDictionary))] - public ICollection>? Order { get; set; } + [JsonConverter(typeof(SingleOrManyCollectionConverter>))] + public ICollection>? Order { get; set; } [JsonInclude, JsonPropertyName("script")] public Elastic.Clients.Elasticsearch.Script? Script { get; set; } @@ -138,7 +138,7 @@ public TermsAggregationDescriptor() : base() private bool? MissingBucketValue { get; set; } private Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? MissingOrderValue { get; set; } private string? NameValue { get; set; } - private ICollection>? OrderValue { get; set; } + private ICollection>? OrderValue { get; set; } private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; } private int? ShardSizeValue { get; set; } private bool? ShowTermDocCountErrorValue { get; set; } @@ -259,7 +259,7 @@ public TermsAggregationDescriptor Name(string? name) /// /// Specifies the sort order of the buckets.
Defaults to sorting by descending document count.
///
- public TermsAggregationDescriptor Order(ICollection>? order) + public TermsAggregationDescriptor Order(ICollection>? order) { OrderValue = order; return Self; @@ -385,7 +385,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o if (OrderValue is not null) { writer.WritePropertyName("order"); - SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); + SingleOrManySerializationHelper.Serialize>(OrderValue, writer, options); } if (ScriptValue is not null) @@ -724,4 +724,4 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteEndObject(); } -} \ No newline at end of file +}