This strongly-typed, client library enables working with Elasticsearch. It is the official client maintained and supported by Elastic.
Fields
type for Field|Field[]
and Field[]
by @flobernd in https://github.com/elastic/elasticsearch-net/pull/8084
Full Changelog: https://github.com/elastic/elasticsearch-net/compare/8.13.1...8.13.2
Full Changelog: https://github.com/elastic/elasticsearch-net/compare/8.13.0...8.13.1
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.
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 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
This version deprecates all synchronous endpoint API methods in the ElasticsearchClient
class (and namespaced versions).
Full Changelog: https://github.com/elastic/elasticsearch-net/compare/8.12.1...8.13.0
Elastic.Transport
dependency by @flobernd in https://github.com/elastic/elasticsearch-net/pull/8059
EsqlQueryResponse
by @flobernd in https://github.com/elastic/elasticsearch-net/pull/8062
Fields
Full Changelog: https://github.com/elastic/elasticsearch-net/compare/8.12.0...8.12.1
https://github.com/elastic/elasticsearch-net/compare/8.11.0...8.12.0
Fields
instanceshttps://github.com/elastic/elasticsearch-net/compare/8.10.0...8.11.0
Stringified
convertershttps://github.com/elastic/elasticsearch-net/compare/8.9.3...8.10.0
TDigestPercentilesAggregate
(issues: #7923, #7879)Similarity
to KnnQuery
(issue: #7952)https://github.com/elastic/elasticsearch-net/compare/8.9.2...8.9.3
PercentilesAggregation
and PercentileRanksAggregation
(issue: #7879)Elastic.Transport
dependencyhttps://github.com/elastic/elasticsearch-net/compare/8.9.1...8.9.2
aggregations
property not being generated for MultisearchBody
(issue #7873)SlowlogTresholds
(issue #7865)/
character from API urls (issue: #7878)SimpleQueryStringQuery.flags
property (issue: #7863)https://github.com/elastic/elasticsearch-net/compare/8.9.0...8.9.1
TextExpansionQuery
definition