Skip to content

Commit 4760e4d

Browse files
committed
Fixes
1 parent e01a7be commit 4760e4d

File tree

6 files changed

+47
-36
lines changed

6 files changed

+47
-36
lines changed

src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/SearchRequest.g.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ public override void Write(Utf8JsonWriter writer, SearchRequest value, JsonSeria
601601
/// <para>Returns search hits that match the query defined in the request.<br/>You can provide search queries using the `q` query string parameter or the request body.<br/>If both are specified, only the query parameter is used.</para>
602602
/// </summary>
603603
[JsonConverter(typeof(SearchRequestConverter))]
604-
public sealed partial class SearchRequest : PlainRequest<SearchRequestParameters>
604+
public partial class SearchRequest : PlainRequest<SearchRequestParameters>
605605
{
606606
public SearchRequest()
607607
{
@@ -3231,4 +3231,4 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
32313231

32323232
writer.WriteEndObject();
32333233
}
3234-
}
3234+
}

src/Elastic.Clients.Elasticsearch.Serverless/_Generated/Types/Aggregations/TermsAggregation.g.cs

+9-9
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ public sealed partial class TermsAggregation
8585
/// <para>Specifies the sort order of the buckets.<br/>Defaults to sorting by descending document count.</para>
8686
/// </summary>
8787
[JsonInclude, JsonPropertyName("order")]
88-
[SingleOrManyCollectionConverter(typeof(IReadOnlyDictionary<Elastic.Clients.Elasticsearch.Serverless.Field, Elastic.Clients.Elasticsearch.Serverless.SortOrder>))]
89-
public ICollection<IDictionary<Elastic.Clients.Elasticsearch.Serverless.Field, Elastic.Clients.Elasticsearch.Serverless.SortOrder>>? Order { get; set; }
88+
[SingleOrManyCollectionConverter(typeof(KeyValuePair<Elastic.Clients.Elasticsearch.Serverless.Field, Elastic.Clients.Elasticsearch.Serverless.SortOrder>))]
89+
public ICollection<KeyValuePair<Elastic.Clients.Elasticsearch.Serverless.Field, Elastic.Clients.Elasticsearch.Serverless.SortOrder>>? Order { get; set; }
9090
[JsonInclude, JsonPropertyName("script")]
9191
public Elastic.Clients.Elasticsearch.Serverless.Script? Script { get; set; }
9292

@@ -138,7 +138,7 @@ public TermsAggregationDescriptor() : base()
138138
private bool? MissingBucketValue { get; set; }
139139
private Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? MissingOrderValue { get; set; }
140140
private string? NameValue { get; set; }
141-
private ICollection<IDictionary<Elastic.Clients.Elasticsearch.Serverless.Field, Elastic.Clients.Elasticsearch.Serverless.SortOrder>>? OrderValue { get; set; }
141+
private ICollection<KeyValuePair<Elastic.Clients.Elasticsearch.Serverless.Field, Elastic.Clients.Elasticsearch.Serverless.SortOrder>>? OrderValue { get; set; }
142142
private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; }
143143
private int? ShardSizeValue { get; set; }
144144
private bool? ShowTermDocCountErrorValue { get; set; }
@@ -259,7 +259,7 @@ public TermsAggregationDescriptor<TDocument> Name(string? name)
259259
/// <summary>
260260
/// <para>Specifies the sort order of the buckets.<br/>Defaults to sorting by descending document count.</para>
261261
/// </summary>
262-
public TermsAggregationDescriptor<TDocument> Order(ICollection<IDictionary<Elastic.Clients.Elasticsearch.Serverless.Field, Elastic.Clients.Elasticsearch.Serverless.SortOrder>>? order)
262+
public TermsAggregationDescriptor<TDocument> Order(ICollection<KeyValuePair<Elastic.Clients.Elasticsearch.Serverless.Field, Elastic.Clients.Elasticsearch.Serverless.SortOrder>>? order)
263263
{
264264
OrderValue = order;
265265
return Self;
@@ -385,7 +385,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
385385
if (OrderValue is not null)
386386
{
387387
writer.WritePropertyName("order");
388-
SingleOrManySerializationHelper.Serialize<IDictionary<Elastic.Clients.Elasticsearch.Serverless.Field, Elastic.Clients.Elasticsearch.Serverless.SortOrder>>(OrderValue, writer, options);
388+
SingleOrManySerializationHelper.Serialize<KeyValuePair<Elastic.Clients.Elasticsearch.Serverless.Field, Elastic.Clients.Elasticsearch.Serverless.SortOrder>>(OrderValue, writer, options);
389389
}
390390

391391
if (ScriptValue is not null)
@@ -442,7 +442,7 @@ public TermsAggregationDescriptor() : base()
442442
private bool? MissingBucketValue { get; set; }
443443
private Elastic.Clients.Elasticsearch.Serverless.Aggregations.MissingOrder? MissingOrderValue { get; set; }
444444
private string? NameValue { get; set; }
445-
private ICollection<IDictionary<Elastic.Clients.Elasticsearch.Serverless.Field, Elastic.Clients.Elasticsearch.Serverless.SortOrder>>? OrderValue { get; set; }
445+
private ICollection<KeyValuePair<Elastic.Clients.Elasticsearch.Serverless.Field, Elastic.Clients.Elasticsearch.Serverless.SortOrder>>? OrderValue { get; set; }
446446
private Elastic.Clients.Elasticsearch.Serverless.Script? ScriptValue { get; set; }
447447
private int? ShardSizeValue { get; set; }
448448
private bool? ShowTermDocCountErrorValue { get; set; }
@@ -563,7 +563,7 @@ public TermsAggregationDescriptor Name(string? name)
563563
/// <summary>
564564
/// <para>Specifies the sort order of the buckets.<br/>Defaults to sorting by descending document count.</para>
565565
/// </summary>
566-
public TermsAggregationDescriptor Order(ICollection<IDictionary<Elastic.Clients.Elasticsearch.Serverless.Field, Elastic.Clients.Elasticsearch.Serverless.SortOrder>>? order)
566+
public TermsAggregationDescriptor Order(ICollection<KeyValuePair<Elastic.Clients.Elasticsearch.Serverless.Field, Elastic.Clients.Elasticsearch.Serverless.SortOrder>>? order)
567567
{
568568
OrderValue = order;
569569
return Self;
@@ -689,7 +689,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
689689
if (OrderValue is not null)
690690
{
691691
writer.WritePropertyName("order");
692-
SingleOrManySerializationHelper.Serialize<IDictionary<Elastic.Clients.Elasticsearch.Serverless.Field, Elastic.Clients.Elasticsearch.Serverless.SortOrder>>(OrderValue, writer, options);
692+
SingleOrManySerializationHelper.Serialize<KeyValuePair<Elastic.Clients.Elasticsearch.Serverless.Field, Elastic.Clients.Elasticsearch.Serverless.SortOrder>>(OrderValue, writer, options);
693693
}
694694

695695
if (ScriptValue is not null)
@@ -724,4 +724,4 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
724724

725725
writer.WriteEndObject();
726726
}
727-
}
727+
}

src/Elastic.Clients.Elasticsearch.Shared/Api/SearchRequest.cs

+11
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,17 @@ protected override (string ResolvedUrl, string UrlTemplate, Dictionary<string, s
3737
}
3838
}
3939

40+
public partial class SearchRequest<TInferDocument> : SearchRequest
41+
{
42+
public SearchRequest(Indices? indices) : base(indices)
43+
{
44+
}
45+
46+
public SearchRequest() : base(typeof(TInferDocument))
47+
{
48+
}
49+
}
50+
4051
public sealed partial class SearchRequestDescriptor<TDocument>
4152
{
4253
public SearchRequestDescriptor<TDocument> Index(Indices indices)

src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ public override void Write(Utf8JsonWriter writer, SearchRequest value, JsonSeria
601601
/// <para>Returns search hits that match the query defined in the request.<br/>You can provide search queries using the `q` query string parameter or the request body.<br/>If both are specified, only the query parameter is used.</para>
602602
/// </summary>
603603
[JsonConverter(typeof(SearchRequestConverter))]
604-
public sealed partial class SearchRequest : PlainRequest<SearchRequestParameters>
604+
public partial class SearchRequest : PlainRequest<SearchRequestParameters>
605605
{
606606
public SearchRequest()
607607
{
@@ -3231,4 +3231,4 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
32313231

32323232
writer.WriteEndObject();
32333233
}
3234-
}
3234+
}

src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.AsyncSearch.g.cs

+14-14
Original file line numberDiff line numberDiff line change
@@ -153,33 +153,33 @@ public virtual Task<GetAsyncSearchResponse<TDocument>> GetAsync<TDocument>(GetAs
153153
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")]
154154
public virtual GetAsyncSearchResponse<TDocument> Get<TDocument>(Elastic.Clients.Elasticsearch.Id id)
155155
{
156-
var descriptor = new GetAsyncSearchRequestDescriptor(id);
156+
var descriptor = new GetAsyncSearchRequestDescriptor<TDocument>(id);
157157
descriptor.BeforeRequest();
158-
return DoRequest<GetAsyncSearchRequestDescriptor, GetAsyncSearchResponse<TDocument>, GetAsyncSearchRequestParameters>(descriptor);
158+
return DoRequest<GetAsyncSearchRequestDescriptor<TDocument>, GetAsyncSearchResponse<TDocument>, GetAsyncSearchRequestParameters>(descriptor);
159159
}
160160

161161
/// <summary>
162162
/// <para>Retrieves the results of a previously submitted async search request given its ID.</para>
163163
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.13/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
164164
/// </summary>
165165
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")]
166-
public virtual GetAsyncSearchResponse<TDocument> Get<TDocument>(GetAsyncSearchRequestDescriptor descriptor)
166+
public virtual GetAsyncSearchResponse<TDocument> Get<TDocument>(GetAsyncSearchRequestDescriptor<TDocument> descriptor)
167167
{
168168
descriptor.BeforeRequest();
169-
return DoRequest<GetAsyncSearchRequestDescriptor, GetAsyncSearchResponse<TDocument>, GetAsyncSearchRequestParameters>(descriptor);
169+
return DoRequest<GetAsyncSearchRequestDescriptor<TDocument>, GetAsyncSearchResponse<TDocument>, GetAsyncSearchRequestParameters>(descriptor);
170170
}
171171

172172
/// <summary>
173173
/// <para>Retrieves the results of a previously submitted async search request given its ID.</para>
174174
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.13/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
175175
/// </summary>
176176
[Obsolete("Synchronous methods are deprecated and could be removed in the future.")]
177-
public virtual GetAsyncSearchResponse<TDocument> Get<TDocument>(Elastic.Clients.Elasticsearch.Id id, Action<GetAsyncSearchRequestDescriptor> configureRequest)
177+
public virtual GetAsyncSearchResponse<TDocument> Get<TDocument>(Elastic.Clients.Elasticsearch.Id id, Action<GetAsyncSearchRequestDescriptor<TDocument>> configureRequest)
178178
{
179-
var descriptor = new GetAsyncSearchRequestDescriptor(id);
179+
var descriptor = new GetAsyncSearchRequestDescriptor<TDocument>(id);
180180
configureRequest?.Invoke(descriptor);
181181
descriptor.BeforeRequest();
182-
return DoRequest<GetAsyncSearchRequestDescriptor, GetAsyncSearchResponse<TDocument>, GetAsyncSearchRequestParameters>(descriptor);
182+
return DoRequest<GetAsyncSearchRequestDescriptor<TDocument>, GetAsyncSearchResponse<TDocument>, GetAsyncSearchRequestParameters>(descriptor);
183183
}
184184

185185
/// <summary>
@@ -188,31 +188,31 @@ public virtual GetAsyncSearchResponse<TDocument> Get<TDocument>(Elastic.Clients.
188188
/// </summary>
189189
public virtual Task<GetAsyncSearchResponse<TDocument>> GetAsync<TDocument>(Elastic.Clients.Elasticsearch.Id id, CancellationToken cancellationToken = default)
190190
{
191-
var descriptor = new GetAsyncSearchRequestDescriptor(id);
191+
var descriptor = new GetAsyncSearchRequestDescriptor<TDocument>(id);
192192
descriptor.BeforeRequest();
193-
return DoRequestAsync<GetAsyncSearchRequestDescriptor, GetAsyncSearchResponse<TDocument>, GetAsyncSearchRequestParameters>(descriptor, cancellationToken);
193+
return DoRequestAsync<GetAsyncSearchRequestDescriptor<TDocument>, GetAsyncSearchResponse<TDocument>, GetAsyncSearchRequestParameters>(descriptor, cancellationToken);
194194
}
195195

196196
/// <summary>
197197
/// <para>Retrieves the results of a previously submitted async search request given its ID.</para>
198198
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.13/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
199199
/// </summary>
200-
public virtual Task<GetAsyncSearchResponse<TDocument>> GetAsync<TDocument>(GetAsyncSearchRequestDescriptor descriptor, CancellationToken cancellationToken = default)
200+
public virtual Task<GetAsyncSearchResponse<TDocument>> GetAsync<TDocument>(GetAsyncSearchRequestDescriptor<TDocument> descriptor, CancellationToken cancellationToken = default)
201201
{
202202
descriptor.BeforeRequest();
203-
return DoRequestAsync<GetAsyncSearchRequestDescriptor, GetAsyncSearchResponse<TDocument>, GetAsyncSearchRequestParameters>(descriptor, cancellationToken);
203+
return DoRequestAsync<GetAsyncSearchRequestDescriptor<TDocument>, GetAsyncSearchResponse<TDocument>, GetAsyncSearchRequestParameters>(descriptor, cancellationToken);
204204
}
205205

206206
/// <summary>
207207
/// <para>Retrieves the results of a previously submitted async search request given its ID.</para>
208208
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.13/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
209209
/// </summary>
210-
public virtual Task<GetAsyncSearchResponse<TDocument>> GetAsync<TDocument>(Elastic.Clients.Elasticsearch.Id id, Action<GetAsyncSearchRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
210+
public virtual Task<GetAsyncSearchResponse<TDocument>> GetAsync<TDocument>(Elastic.Clients.Elasticsearch.Id id, Action<GetAsyncSearchRequestDescriptor<TDocument>> configureRequest, CancellationToken cancellationToken = default)
211211
{
212-
var descriptor = new GetAsyncSearchRequestDescriptor(id);
212+
var descriptor = new GetAsyncSearchRequestDescriptor<TDocument>(id);
213213
configureRequest?.Invoke(descriptor);
214214
descriptor.BeforeRequest();
215-
return DoRequestAsync<GetAsyncSearchRequestDescriptor, GetAsyncSearchResponse<TDocument>, GetAsyncSearchRequestParameters>(descriptor, cancellationToken);
215+
return DoRequestAsync<GetAsyncSearchRequestDescriptor<TDocument>, GetAsyncSearchResponse<TDocument>, GetAsyncSearchRequestParameters>(descriptor, cancellationToken);
216216
}
217217

218218
/// <summary>

src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.g.cs

+9-9
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ public sealed partial class TermsAggregation
8585
/// <para>Specifies the sort order of the buckets.<br/>Defaults to sorting by descending document count.</para>
8686
/// </summary>
8787
[JsonInclude, JsonPropertyName("order")]
88-
[SingleOrManyCollectionConverter(typeof(IReadOnlyDictionary<Elastic.Clients.Elasticsearch.Field, Elastic.Clients.Elasticsearch.SortOrder>))]
89-
public ICollection<IDictionary<Elastic.Clients.Elasticsearch.Field, Elastic.Clients.Elasticsearch.SortOrder>>? Order { get; set; }
88+
[JsonConverter(typeof(SingleOrManyCollectionConverter<KeyValuePair<Elastic.Clients.Elasticsearch.Field, Elastic.Clients.Elasticsearch.SortOrder>>))]
89+
public ICollection<KeyValuePair<Elastic.Clients.Elasticsearch.Field, Elastic.Clients.Elasticsearch.SortOrder>>? Order { get; set; }
9090
[JsonInclude, JsonPropertyName("script")]
9191
public Elastic.Clients.Elasticsearch.Script? Script { get; set; }
9292

@@ -138,7 +138,7 @@ public TermsAggregationDescriptor() : base()
138138
private bool? MissingBucketValue { get; set; }
139139
private Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? MissingOrderValue { get; set; }
140140
private string? NameValue { get; set; }
141-
private ICollection<IDictionary<Elastic.Clients.Elasticsearch.Field, Elastic.Clients.Elasticsearch.SortOrder>>? OrderValue { get; set; }
141+
private ICollection<KeyValuePair<Elastic.Clients.Elasticsearch.Field, Elastic.Clients.Elasticsearch.SortOrder>>? OrderValue { get; set; }
142142
private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; }
143143
private int? ShardSizeValue { get; set; }
144144
private bool? ShowTermDocCountErrorValue { get; set; }
@@ -259,7 +259,7 @@ public TermsAggregationDescriptor<TDocument> Name(string? name)
259259
/// <summary>
260260
/// <para>Specifies the sort order of the buckets.<br/>Defaults to sorting by descending document count.</para>
261261
/// </summary>
262-
public TermsAggregationDescriptor<TDocument> Order(ICollection<IDictionary<Elastic.Clients.Elasticsearch.Field, Elastic.Clients.Elasticsearch.SortOrder>>? order)
262+
public TermsAggregationDescriptor<TDocument> Order(ICollection<KeyValuePair<Elastic.Clients.Elasticsearch.Field, Elastic.Clients.Elasticsearch.SortOrder>>? order)
263263
{
264264
OrderValue = order;
265265
return Self;
@@ -385,7 +385,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
385385
if (OrderValue is not null)
386386
{
387387
writer.WritePropertyName("order");
388-
SingleOrManySerializationHelper.Serialize<IDictionary<Elastic.Clients.Elasticsearch.Field, Elastic.Clients.Elasticsearch.SortOrder>>(OrderValue, writer, options);
388+
SingleOrManySerializationHelper.Serialize<KeyValuePair<Elastic.Clients.Elasticsearch.Field, Elastic.Clients.Elasticsearch.SortOrder>>(OrderValue, writer, options);
389389
}
390390

391391
if (ScriptValue is not null)
@@ -442,7 +442,7 @@ public TermsAggregationDescriptor() : base()
442442
private bool? MissingBucketValue { get; set; }
443443
private Elastic.Clients.Elasticsearch.Aggregations.MissingOrder? MissingOrderValue { get; set; }
444444
private string? NameValue { get; set; }
445-
private ICollection<IDictionary<Elastic.Clients.Elasticsearch.Field, Elastic.Clients.Elasticsearch.SortOrder>>? OrderValue { get; set; }
445+
private ICollection<KeyValuePair<Elastic.Clients.Elasticsearch.Field, Elastic.Clients.Elasticsearch.SortOrder>>? OrderValue { get; set; }
446446
private Elastic.Clients.Elasticsearch.Script? ScriptValue { get; set; }
447447
private int? ShardSizeValue { get; set; }
448448
private bool? ShowTermDocCountErrorValue { get; set; }
@@ -563,7 +563,7 @@ public TermsAggregationDescriptor Name(string? name)
563563
/// <summary>
564564
/// <para>Specifies the sort order of the buckets.<br/>Defaults to sorting by descending document count.</para>
565565
/// </summary>
566-
public TermsAggregationDescriptor Order(ICollection<IDictionary<Elastic.Clients.Elasticsearch.Field, Elastic.Clients.Elasticsearch.SortOrder>>? order)
566+
public TermsAggregationDescriptor Order(ICollection<KeyValuePair<Elastic.Clients.Elasticsearch.Field, Elastic.Clients.Elasticsearch.SortOrder>>? order)
567567
{
568568
OrderValue = order;
569569
return Self;
@@ -689,7 +689,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
689689
if (OrderValue is not null)
690690
{
691691
writer.WritePropertyName("order");
692-
SingleOrManySerializationHelper.Serialize<IDictionary<Elastic.Clients.Elasticsearch.Field, Elastic.Clients.Elasticsearch.SortOrder>>(OrderValue, writer, options);
692+
SingleOrManySerializationHelper.Serialize<KeyValuePair<Elastic.Clients.Elasticsearch.Field, Elastic.Clients.Elasticsearch.SortOrder>>(OrderValue, writer, options);
693693
}
694694

695695
if (ScriptValue is not null)
@@ -724,4 +724,4 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
724724

725725
writer.WriteEndObject();
726726
}
727-
}
727+
}

0 commit comments

Comments
 (0)