Skip to content

Commit 7c81679

Browse files
floberndgithub-actions[bot]
authored andcommitted
Add PercentilesAggregation and PercentileRanksAggregation (#7923)
1 parent f3d3584 commit 7c81679

11 files changed

+1588
-0
lines changed

src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/AsyncSearchStatusResponse.g.cs

+10
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,21 @@ namespace Elastic.Clients.Elasticsearch.AsyncSearch;
2828

2929
public sealed partial class AsyncSearchStatusResponse : ElasticsearchResponse
3030
{
31+
/// <summary>
32+
/// <para>Metadata about clusters involved in the cross-cluster search.<br/>Not shown for local-only searches.</para>
33+
/// </summary>
34+
[JsonInclude, JsonPropertyName("_clusters")]
35+
public Elastic.Clients.Elasticsearch.ClusterStatistics? Clusters { get; init; }
36+
3137
/// <summary>
3238
/// <para>If the async search completed, this field shows the status code of the search.<br/>For example, 200 indicates that the async search was successfully completed.<br/>503 indicates that the async search was completed with an error.</para>
3339
/// </summary>
3440
[JsonInclude, JsonPropertyName("completion_status")]
3541
public int? CompletionStatus { get; init; }
42+
[JsonInclude, JsonPropertyName("completion_time")]
43+
public DateTimeOffset? CompletionTime { get; init; }
44+
[JsonInclude, JsonPropertyName("completion_time_in_millis")]
45+
public long? CompletionTimeInMillis { get; init; }
3646
[JsonInclude, JsonPropertyName("expiration_time")]
3747
public DateTimeOffset? ExpirationTime { get; init; }
3848
[JsonInclude, JsonPropertyName("expiration_time_in_millis")]

src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/GetAsyncSearchResponse.g.cs

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ namespace Elastic.Clients.Elasticsearch.AsyncSearch;
2828

2929
public sealed partial class GetAsyncSearchResponse<TDocument> : ElasticsearchResponse
3030
{
31+
[JsonInclude, JsonPropertyName("completion_time")]
32+
public DateTimeOffset? CompletionTime { get; init; }
33+
[JsonInclude, JsonPropertyName("completion_time_in_millis")]
34+
public long? CompletionTimeInMillis { get; init; }
3135
[JsonInclude, JsonPropertyName("expiration_time")]
3236
public DateTimeOffset? ExpirationTime { get; init; }
3337
[JsonInclude, JsonPropertyName("expiration_time_in_millis")]

src/Elastic.Clients.Elasticsearch/_Generated/Api/AsyncSearch/SubmitAsyncSearchResponse.g.cs

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ namespace Elastic.Clients.Elasticsearch.AsyncSearch;
2828

2929
public sealed partial class SubmitAsyncSearchResponse<TDocument> : ElasticsearchResponse
3030
{
31+
[JsonInclude, JsonPropertyName("completion_time")]
32+
public DateTimeOffset? CompletionTime { get; init; }
33+
[JsonInclude, JsonPropertyName("completion_time_in_millis")]
34+
public long? CompletionTimeInMillis { get; init; }
3135
[JsonInclude, JsonPropertyName("expiration_time")]
3236
public DateTimeOffset? ExpirationTime { get; init; }
3337
[JsonInclude, JsonPropertyName("expiration_time_in_millis")]

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

+40
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,16 @@ public override Aggregation Read(ref Utf8JsonReader reader, Type typeToConvert,
232232
return AggregationSerializationHelper.ReadContainer<Elastic.Clients.Elasticsearch.Aggregations.ParentAggregation?>("parent", ref reader, options);
233233
}
234234

235+
if (propertyName == "percentile_ranks")
236+
{
237+
return AggregationSerializationHelper.ReadContainer<Elastic.Clients.Elasticsearch.Aggregations.PercentileRanksAggregation?>("percentile_ranks", ref reader, options);
238+
}
239+
240+
if (propertyName == "percentiles")
241+
{
242+
return AggregationSerializationHelper.ReadContainer<Elastic.Clients.Elasticsearch.Aggregations.PercentilesAggregation?>("percentiles", ref reader, options);
243+
}
244+
235245
if (propertyName == "percentiles_bucket")
236246
{
237247
return AggregationSerializationHelper.ReadContainer<Elastic.Clients.Elasticsearch.Aggregations.PercentilesBucketAggregation?>("percentiles_bucket", ref reader, options);
@@ -545,6 +555,16 @@ public AggregationDescriptor<TDocument> Parent(string name, Action<ParentAggrega
545555
return SetContainer(name, Aggregation.CreateWithAction("parent", configure));
546556
}
547557

558+
public AggregationDescriptor<TDocument> PercentileRanks(string name, Action<PercentileRanksAggregationDescriptor<TDocument>> configure)
559+
{
560+
return SetContainer(name, Aggregation.CreateWithAction("percentile_ranks", configure));
561+
}
562+
563+
public AggregationDescriptor<TDocument> Percentiles(string name, Action<PercentilesAggregationDescriptor<TDocument>> configure)
564+
{
565+
return SetContainer(name, Aggregation.CreateWithAction("percentiles", configure));
566+
}
567+
548568
public AggregationDescriptor<TDocument> PercentilesBucket(string name, Action<PercentilesBucketAggregationDescriptor> configure)
549569
{
550570
return SetContainer(name, Aggregation.CreateWithAction("percentiles_bucket", configure));
@@ -999,6 +1019,26 @@ public AggregationDescriptor Parent<TDocument>(string name, Action<ParentAggrega
9991019
return SetContainer(name, Aggregation.CreateWithAction("parent", configure));
10001020
}
10011021

1022+
public AggregationDescriptor PercentileRanks(string name, Action<PercentileRanksAggregationDescriptor> configure)
1023+
{
1024+
return SetContainer(name, Aggregation.CreateWithAction("percentile_ranks", configure));
1025+
}
1026+
1027+
public AggregationDescriptor PercentileRanks<TDocument>(string name, Action<PercentileRanksAggregationDescriptor<TDocument>> configure)
1028+
{
1029+
return SetContainer(name, Aggregation.CreateWithAction("percentile_ranks", configure));
1030+
}
1031+
1032+
public AggregationDescriptor Percentiles(string name, Action<PercentilesAggregationDescriptor> configure)
1033+
{
1034+
return SetContainer(name, Aggregation.CreateWithAction("percentiles", configure));
1035+
}
1036+
1037+
public AggregationDescriptor Percentiles<TDocument>(string name, Action<PercentilesAggregationDescriptor<TDocument>> configure)
1038+
{
1039+
return SetContainer(name, Aggregation.CreateWithAction("percentiles", configure));
1040+
}
1041+
10021042
public AggregationDescriptor PercentilesBucket(string name, Action<PercentilesBucketAggregationDescriptor> configure)
10031043
{
10041044
return SetContainer(name, Aggregation.CreateWithAction("percentiles_bucket", configure));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// Licensed to Elasticsearch B.V under one or more agreements.
2+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+
// See the LICENSE file in the project root for more information.
4+
//
5+
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
6+
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
7+
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
8+
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
9+
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
10+
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
11+
// ------------------------------------------------
12+
//
13+
// This file is automatically generated.
14+
// Please do not edit these files manually.
15+
//
16+
// ------------------------------------------------
17+
18+
#nullable restore
19+
20+
using Elastic.Clients.Elasticsearch.Fluent;
21+
using Elastic.Clients.Elasticsearch.Serialization;
22+
using System;
23+
using System.Collections.Generic;
24+
using System.Linq.Expressions;
25+
using System.Text.Json;
26+
using System.Text.Json.Serialization;
27+
28+
namespace Elastic.Clients.Elasticsearch.Aggregations;
29+
30+
public sealed partial class HdrMethod
31+
{
32+
/// <summary>
33+
/// <para>Specifies the resolution of values for the histogram in number of significant digits.</para>
34+
/// </summary>
35+
[JsonInclude, JsonPropertyName("number_of_significant_value_digits")]
36+
public int? NumberOfSignificantValueDigits { get; set; }
37+
}
38+
39+
public sealed partial class HdrMethodDescriptor : SerializableDescriptor<HdrMethodDescriptor>
40+
{
41+
internal HdrMethodDescriptor(Action<HdrMethodDescriptor> configure) => configure.Invoke(this);
42+
43+
public HdrMethodDescriptor() : base()
44+
{
45+
}
46+
47+
private int? NumberOfSignificantValueDigitsValue { get; set; }
48+
49+
/// <summary>
50+
/// <para>Specifies the resolution of values for the histogram in number of significant digits.</para>
51+
/// </summary>
52+
public HdrMethodDescriptor NumberOfSignificantValueDigits(int? numberOfSignificantValueDigits)
53+
{
54+
NumberOfSignificantValueDigitsValue = numberOfSignificantValueDigits;
55+
return Self;
56+
}
57+
58+
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
59+
{
60+
writer.WriteStartObject();
61+
if (NumberOfSignificantValueDigitsValue.HasValue)
62+
{
63+
writer.WritePropertyName("number_of_significant_value_digits");
64+
writer.WriteNumberValue(NumberOfSignificantValueDigitsValue.Value);
65+
}
66+
67+
writer.WriteEndObject();
68+
}
69+
}

0 commit comments

Comments
 (0)