Releases: elastic/elasticsearch-net
8.13.0
Introduction
This version of the client is the first one generated by a completely revised code generator. In addition to more than 200 new endpoints, which were not yet supported in 8.12.1, 8.13.0 finally supports all aggregations and many other previously unavailable features.
The support of these new functions is accompanied by some breaking changes. In the next section, we have been working to document all of these changes and show the new usage with code examples. If you come across any undocumented changes, please feel free to open an issue
Although the most common endpoints have been tested by hand, there is a possibility that this version contains a few minor bugs. If you come across such a bug, please let us know. Over the next few weeks, we will closely monitor the issue tracker and respond quickly with appropriate patch releases.
Breaking Changes
Aggregations
The aggregation name and the sub-aggregations property was pulled out of the actual aggregation variant classes. The usage changes from:
var aggExampleResponse = await client.SearchAsync<StockData>(s => s
.Aggregations(aggs => aggs
.DateHistogram("by-month", dh => dh
.CalendarInterval(CalendarInterval.Month)
.Field(fld => fld.Date)
.Aggregations(subaggs => subaggs
.Sum("trade-volumes", sum => sum.Field(fld => fld.Volume))
)
)
)
);
to:
var aggExampleResponse = await client.SearchAsync<StockData>(s => s
.Aggregations(aggs => aggs
.Add("by-month", agg => agg
.DateHistogram(dh => dh
.CalendarInterval(CalendarInterval.Month)
.Field(fld => fld.Date)
)
.Aggregations(subaggs => subaggs
.Add("trade-volumes", agg => agg
.Sum(sum => sum.Field(fld => fld.Volume))
)
)
)
)
);
In the response, the sub-aggregations are no longer part of the bucket class itself, but must be accessed through the Aggregations
property instead. Usage changes from:
var monthlyBuckets = aggExampleResponse.Aggregations?.GetDateHistogram("by-month")?.Buckets ?? Array.Empty<DateHistogramBucket>();
foreach (var monthlyBucket in monthlyBuckets)
{
var volume = monthlyBucket.GetSum("trade-volumes");
Console.WriteLine($"{monthlyBucket.Key} : {volume}");
}
to:
var monthlyBuckets = aggExampleResponse.Aggregations?.GetDateHistogram("by-month")?.Buckets ?? Array.Empty<DateHistogramBucket>();
foreach (var monthlyBucket in monthlyBuckets)
{
var volume = monthlyBucket.Aggregations.GetSum("trade-volumes");
Console.WriteLine($"{monthlyBucket.Key} : {volume}");
}
Please as well note, that it is no longer possible to compose a dictionary/list of aggregations using the &&
operator.
Query
Query variants no longer derive from SearchQuery
. This has some implications on usage. Instead of being able to e.g. use logical operators on query variants like this:
var myQuery = new TermQuery("field") { Value = "a" } || new TermQuery("field") { Value = "b" };
// => BoolQuery variant
you have to wrap the query into the container first:
var myQuery = Query.Term(new("field") { Value = "a" }) || Query.Term(new("field") { Value = "b" });
// => Query container that wraps a BoolQuery variant
Deprecation of synchronous APIs
This version deprecates all synchronous endpoint API methods in the ElasticsearchClient
class (and namespaced versions).
What's Changed
- Regenerate client for 8.13 (#8071)
Full Changelog: 8.12.1...8.13.0
8.12.1
What's Changed
- Update TargetFrameworks by @gpetrou in #8052
- Use JsonPropertyName in Ranges by @gpetrou in #8053
- Fix RawJsonString serialization by @f1nzer in #8051
- Update
Elastic.Transport
dependency by @flobernd in #8059 - Implement proper deserialization of
EsqlQueryResponse
by @flobernd in #8062 - Revert #8018 to fix (de-)serialization of
Fields
New Contributors
Full Changelog: 8.12.0...8.12.1
8.12.0
Features & Enhancements
- #8027 Regenerate client for 8.12
Bug Fixes
- #8018 Fix serialisation of empty and single item
Fields
instances
View the full list of issues and PRs
8.11.0
Features & Enhancements
- #7978 Regenerate client for 8.11
Bug fixes
- #7979 Add workaround for stringified properties which are not marked properly in specification
- #7965 Fix
Stringified
converters
View the full list of issues and PRs
8.10.0
8.9.3
8.9.2
8.9.1
8.9.0
Bug fixes
- #7839 Use
Stringified<boolean>
forpreserve_original
andindexing_complete
(issue: #7755) - #7840 Update
Elastic.*
dependencies (issue: #7823) - #7841 Fix typing of
BulkUpdateOperation.RetryOnConflict
(issue: #7838) - #7854 Fix custom floating-point JSON converters (issue: #7757)
Enhancements
- #7836 Regenerate client using 8.9 specification
View the full list of issues and PRs
8.1.3
Bug fixes
- #7737 Boosted non-exhaustive enum deserialization (issue: #7729)
- #7738 Complted buckets JSON converter (issue: #7713)
- #7753 Number converters should not fall through and throw exceptions in non NETCore builds (issue: #7757)
- #7811 Fix localization issue with floating-point deserialization from string
Enhancements
- #7730 Refactoring and tiny behavior fix for Ids
- #7731 No allocations in
ResponseItem.IsValid
property - #7733 Fixed the equality contract on Metrics type
- #7735 Removed unused
JsonIgnore
- #7736 Optimized
FieldConverter