Skip to content

Add support for additional bucket aggregations. #7485

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions exclusion.dic
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
deserialize
json
async
inferrer
elasticsearch
asciidocs
yyyy
enum
trippable
trippable
geotile

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ public static void ReadAggregate(ref Utf8JsonReader reader, JsonSerializerOption
break;
}

case "categorize_text":
throw new Exception("The aggregate in response is not yet supported");

case "children":
{
var agg = JsonSerializer.Deserialize<ChildrenAggregate>(ref reader, options);
Expand Down Expand Up @@ -105,9 +102,6 @@ public static void ReadAggregate(ref Utf8JsonReader reader, JsonSerializerOption
break;
}

case "diversified_sampler":
throw new Exception("The aggregate in response is not yet supported");

case "filter":
{
var agg = JsonSerializer.Deserialize<FilterAggregate>(ref reader, options);
Expand All @@ -122,26 +116,26 @@ public static void ReadAggregate(ref Utf8JsonReader reader, JsonSerializerOption
break;
}

//case "geo_distance":
// {
// var agg = JsonSerializer.Deserialize<GeoDistanceAggregate>(ref reader, options);
// dictionary.Add(nameParts[1], agg);
// break;
// }
case "geo_distance":
{
var agg = JsonSerializer.Deserialize<GeoDistanceAggregate>(ref reader, options);
dictionary.Add(nameParts[1], agg);
break;
}

//case "geohash_grid":
// {
// var agg = JsonSerializer.Deserialize<GeoHashGridAggregate>(ref reader, options);
// dictionary.Add(nameParts[1], agg);
// break;
// }
case "geohash_grid":
{
var agg = JsonSerializer.Deserialize<GeohashGridAggregate>(ref reader, options);
dictionary.Add(nameParts[1], agg);
break;
}

//case "geotile_grid":
// {
// var agg = JsonSerializer.Deserialize<GeoTileGridAggregate>(ref reader, options);
// dictionary.Add(nameParts[1], agg);
// break;
// }
case "geotile_grid":
{
var agg = JsonSerializer.Deserialize<GeotileGridAggregate>(ref reader, options);
dictionary.Add(nameParts[1], agg);
break;
}

case "global":
{
Expand All @@ -164,6 +158,13 @@ public static void ReadAggregate(ref Utf8JsonReader reader, JsonSerializerOption
break;
}

case "ip_prefix":
{
var agg = JsonSerializer.Deserialize<IpPrefixAggregate>(ref reader, options);
dictionary.Add(nameParts[1], agg);
break;
}

case "missing":
{
var agg = JsonSerializer.Deserialize<MissingAggregate>(ref reader, options);
Expand Down Expand Up @@ -199,9 +200,6 @@ public static void ReadAggregate(ref Utf8JsonReader reader, JsonSerializerOption
break;
}

case "rare_terms":
throw new Exception("The aggregate in response is not yet supported");

case "reverse_nested":
{
var agg = JsonSerializer.Deserialize<ReverseNestedAggregate>(ref reader, options);
Expand All @@ -216,11 +214,12 @@ public static void ReadAggregate(ref Utf8JsonReader reader, JsonSerializerOption
break;
}

case "significant_terms":
throw new Exception("The aggregate in response is not yet supported");

case "significant_text":
throw new Exception("The aggregate in response is not yet supported");
case "sigsterms":
{
var agg = JsonSerializer.Deserialize<SignificantStringTermsAggregate>(ref reader, options);
dictionary.Add(nameParts[1], agg);
break;
}

case "variable_width_histogram":
{
Expand All @@ -231,14 +230,14 @@ public static void ReadAggregate(ref Utf8JsonReader reader, JsonSerializerOption

case "avg":
{
var agg = JsonSerializer.Deserialize<AvgAggregate>(ref reader, options);
var agg = JsonSerializer.Deserialize<AverageAggregate>(ref reader, options);
dictionary.Add(nameParts[1], agg);
break;
}

case "boxplot":
{
var agg = JsonSerializer.Deserialize<BoxPlotAggregate>(ref reader, options);
var agg = JsonSerializer.Deserialize<BoxplotAggregate>(ref reader, options);
dictionary.Add(nameParts[1], agg);
break;
}
Expand Down Expand Up @@ -278,6 +277,13 @@ public static void ReadAggregate(ref Utf8JsonReader reader, JsonSerializerOption
// break;
// }

case "srareterms":
{
var agg = JsonSerializer.Deserialize<StringRareTermsAggregate>(ref reader, options);
dictionary.Add(nameParts[1], agg);
break;
}

case "matrix_stats":
{
var agg = JsonSerializer.Deserialize<MatrixStatsAggregate>(ref reader, options);
Expand Down Expand Up @@ -306,19 +312,13 @@ public static void ReadAggregate(ref Utf8JsonReader reader, JsonSerializerOption
break;
}

case "percentile_ranks":
throw new Exception("The aggregate in response is not yet supported.");

case "tdigest_percentile_ranks":
{
var agg = JsonSerializer.Deserialize<TDigestPercentileRanksAggregate>(ref reader, options);
dictionary.Add(nameParts[1], agg);
break;
}

case "percentiles":
throw new Exception("The aggregate in response is not yet supported.");

case "rate":
{
var agg = JsonSerializer.Deserialize<RateAggregate>(ref reader, options);
Expand Down Expand Up @@ -384,22 +384,11 @@ public static void ReadAggregate(ref Utf8JsonReader reader, JsonSerializerOption

case "weighted_avg":
{
var agg = JsonSerializer.Deserialize<WeightedAvgAggregate>(ref reader, options);
var agg = JsonSerializer.Deserialize<WeightedAverageAggregate>(ref reader, options);
dictionary.Add(nameParts[1], agg);
break;
}

case "avg_bucket":
throw new Exception("The aggregate in response is not yet supported.");
case "bucket_script":
throw new Exception("The aggregate in response is not yet supported.");
case "bucket_count_ks_test":
throw new Exception("The aggregate in response is not yet supported.");
case "bucket_correlation":
throw new Exception("The aggregate in response is not yet supported.");
case "bucket_selector":
throw new Exception("The aggregate in response is not yet supported.");

case "cumulative_cardinality":
{
var agg = JsonSerializer.Deserialize<CumulativeCardinalityAggregate>(ref reader, options);
Expand Down Expand Up @@ -436,42 +425,22 @@ public static void ReadAggregate(ref Utf8JsonReader reader, JsonSerializerOption
dictionary.Add(nameParts[1], agg);
break;
}

case "max_bucket":
throw new Exception("The aggregate in response is not yet supported.");
case "min_bucket":
throw new Exception("The aggregate in response is not yet supported.");
case "moving_avg":
throw new Exception("The aggregate in response is not yet supported.");
case "moving_fn":
throw new Exception("The aggregate in response is not yet supported.");
case "moving_percentiles":
throw new Exception("The aggregate in response is not yet supported.");
case "normalize":
throw new Exception("The aggregate in response is not yet supported.");

case "percentiles_bucket":
{
var agg = JsonSerializer.Deserialize<PercentilesBucketAggregate>(ref reader, options);
dictionary.Add(nameParts[1], agg);
break;
}

case "serial_diff":
throw new Exception("The aggregate in response is not yet supported.");

case "stats_bucket":
{
var agg = JsonSerializer.Deserialize<StatsBucketAggregate>(ref reader, options);
dictionary.Add(nameParts[1], agg);
break;
}

case "sum_bucket":
throw new Exception("The aggregate in response is not yet supported.");

default:
throw new Exception("The aggregate in response is not yet supported.");
throw new Exception($"The aggregate '{aggregateName}' in this response is not currently supported.");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ internal AsyncSearchNamespacedClient(ElasticsearchClient client) : base(client)

/// <summary>
/// <para>Retrieves the status of a previously submitted async search request given its ID.</para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.7/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.6/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// </summary>
public virtual AsyncSearchStatusResponse Status(AsyncSearchStatusRequest request)
{
Expand All @@ -48,7 +48,7 @@ public virtual AsyncSearchStatusResponse Status(AsyncSearchStatusRequest request

/// <summary>
/// <para>Retrieves the status of a previously submitted async search request given its ID.</para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.7/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.6/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// </summary>
public virtual Task<AsyncSearchStatusResponse> StatusAsync(AsyncSearchStatusRequest request, CancellationToken cancellationToken = default)
{
Expand Down Expand Up @@ -104,7 +104,7 @@ public virtual Task<AsyncSearchStatusResponse> StatusAsync<TDocument>(Elastic.Cl

/// <summary>
/// <para>Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted.</para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.7/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.6/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// </summary>
public virtual DeleteAsyncSearchResponse Delete(DeleteAsyncSearchRequest request)
{
Expand All @@ -114,7 +114,7 @@ public virtual DeleteAsyncSearchResponse Delete(DeleteAsyncSearchRequest request

/// <summary>
/// <para>Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted.</para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.7/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.6/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// </summary>
public virtual Task<DeleteAsyncSearchResponse> DeleteAsync(DeleteAsyncSearchRequest request, CancellationToken cancellationToken = default)
{
Expand Down Expand Up @@ -170,7 +170,7 @@ public virtual Task<DeleteAsyncSearchResponse> DeleteAsync<TDocument>(Elastic.Cl

/// <summary>
/// <para>Retrieves the results of a previously submitted async search request given its ID.</para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.7/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.6/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// </summary>
public virtual GetAsyncSearchResponse<TDocument> Get<TDocument>(GetAsyncSearchRequest request)
{
Expand All @@ -180,7 +180,7 @@ public virtual GetAsyncSearchResponse<TDocument> Get<TDocument>(GetAsyncSearchRe

/// <summary>
/// <para>Retrieves the results of a previously submitted async search request given its ID.</para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.7/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.6/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// </summary>
public virtual Task<GetAsyncSearchResponse<TDocument>> GetAsync<TDocument>(GetAsyncSearchRequest request, CancellationToken cancellationToken = default)
{
Expand Down Expand Up @@ -220,7 +220,7 @@ public virtual Task<GetAsyncSearchResponse<TDocument>> GetAsync<TDocument>(Elast

/// <summary>
/// <para>Executes a search request asynchronously.</para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.7/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.6/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// </summary>
public virtual SubmitAsyncSearchResponse<TDocument> Submit<TDocument>(SubmitAsyncSearchRequest request)
{
Expand All @@ -230,7 +230,7 @@ public virtual SubmitAsyncSearchResponse<TDocument> Submit<TDocument>(SubmitAsyn

/// <summary>
/// <para>Executes a search request asynchronously.</para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.7/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.6/async-search.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// </summary>
public virtual Task<SubmitAsyncSearchResponse<TDocument>> SubmitAsync<TDocument>(SubmitAsyncSearchRequest request, CancellationToken cancellationToken = default)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ internal ClusterNamespacedClient(ElasticsearchClient client) : base(client)

/// <summary>
/// <para>Returns basic information about the health of the cluster.</para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.7/cluster-health.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.6/cluster-health.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// </summary>
public virtual HealthResponse Health(HealthRequest request)
{
Expand All @@ -48,7 +48,7 @@ public virtual HealthResponse Health(HealthRequest request)

/// <summary>
/// <para>Returns basic information about the health of the cluster.</para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.7/cluster-health.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/8.6/cluster-health.html">Learn more about this API in the Elasticsearch documentation.</see></para>
/// </summary>
public virtual Task<HealthResponse> HealthAsync(HealthRequest request, CancellationToken cancellationToken = default)
{
Expand Down
Loading