NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
NuGet
NuGet, #1336 most downloaded on NuGet
NEST uses an internal serializer. This package enables serialization for your documents using your own custom Json.NET serializer
Latest stable
7.17.5
Last release 4 years ago
no release in 18 months
Ships fairly regularly
a new release about every 5 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
1 version withdrawn
withdrawn after publishing
127 years old
74 releases · first in 1900
Drag across the ruler to compare, or tap a release to open it.
https://github.com/elastic/elasticsearch-net/compare/7.17.4...7.17.5
https://github.com/elastic/elasticsearch-net/compare/7.17.4...7.17.5
https://github.com/elastic/elasticsearch-net/compare/7.17.3...7.17.4
https://github.com/elastic/elasticsearch-net/compare/7.17.3...7.17.4
Your coding agent can read these notes before it upgrades. Set up the MCP server →
https://github.com/elastic/elasticsearch-net/compare/7.17.2...7.17.3
https://github.com/elastic/elasticsearch-net/compare/7.17.2...7.17.3
https://github.com/elastic/elasticsearch-net/compare/7.17.1...7.17.2
https://github.com/elastic/elasticsearch-net/compare/7.17.1...7.17.2
https://github.com/elastic/elasticsearch-net/compare/7.17.0...7.17.1
https://github.com/elastic/elasticsearch-net/compare/7.17.0...7.17.1
https://github.com/elastic/elasticsearch-net/compare/7.16.0...7.17.0
https://github.com/elastic/elasticsearch-net/compare/7.16.0...7.17.0
IgnoreUnmapped to GeoDistanceQuery, GeoBoundingBoxQuery and GeoPolygon (issue: #6066)IpProperty (issue: #6067)TermVectorOption (issue: #6078)To align with naming elsewhere during the implementation of NEST APIs for index template v2, some of the low-level client types and methods have been renamed:
https://github.com/elastic/elasticsearch-net/compare/7.15.2...7.16.0
https://github.com/elastic/elasticsearch-net/compare/7.15.2...7.16.0
https://github.com/elastic/elasticsearch-net/compare/7.15.1...7.15.2
https://github.com/elastic/elasticsearch-net/compare/7.15.1...7.15.2
wildcard field in WildcardQuery (issue: #6033)https://github.com/elastic/elasticsearch-net/compare/7.15.0...7.15.1
https://github.com/elastic/elasticsearch-net/compare/7.15.0...7.15.1
https://github.com/elastic/elasticsearch-net/compare/7.14.1...7.15.0
https://github.com/elastic/elasticsearch-net/compare/7.14.1...7.15.0
index parameter is now required for the Open Point in Time API.https://github.com/elastic/elasticsearch-net/compare/7.14.0...7.14.1
https://github.com/elastic/elasticsearch-net/compare/7.14.0...7.14.1
https://github.com/elastic/elasticsearch-net/compare/7.13.2...7.14.0
https://github.com/elastic/elasticsearch-net/compare/7.13.2...7.14.0
UnsupportedProductException will be thrown.https://github.com/elastic/elasticsearch-net/compare/7.13.1...7.13.2
https://github.com/elastic/elasticsearch-net/compare/7.13.1...7.13.2
https://github.com/elastic/elasticsearch-net/compare/7.13.0...7.13.1
https://github.com/elastic/elasticsearch-net/compare/7.13.0...7.13.1
This is a breaking change but should have a limited impact on existing users and ultimately was worth making to allow consumers to fully utilise runti…
https://github.com/elastic/elasticsearch-net/compare/7.12.1...7.13.0
Runtime fields now support parameters in their scripts which the current IStoredScript interface, used on IRuntimeField did not support. This change updates the IRuntimeField interface Script property to use IInlineScript which better aligns to the functionality of scripts in runtime fields. The implementation and RuntimeFieldDescriptor were update accordingly.
This is a breaking change but should have a limited impact on existing users and ultimately was worth making to allow consumers to fully utilise runtime fields. Code currently using runtime fields and the object initializer syntax may need to be updated. The change required is to create an instance of InlineScript rather than PainlessScript when setting the Script property.
To fully support new EQL APIs and map implementations in NEST, the generated code has resulted in renaming a few types...
DeleteRequestParameters renamed to EqlDeleteRequestParametersGetRequestParameters renamed to EqlGetRequestParametersGetStatusRequestParameters renamed to EqlSearchStatusRequestParametersIn addition, the PreviewDatafeed<T> low-level client method now accepts PostData as an argument.
https://github.com/elastic/elasticsearch-net/compare/7.12.0...7.12.1
https://github.com/elastic/elasticsearch-net/compare/7.12.0...7.12.1
https://github.com/elastic/elasticsearch-net/compare/7.11.1...7.12.0
https://github.com/elastic/elasticsearch-net/compare/7.11.1...7.12.0
https://github.com/elastic/elasticsearch-net/compare/7.11.0...7.11.1
https://github.com/elastic/elasticsearch-net/compare/7.11.0...7.11.1
https://github.com/elastic/elasticsearch-net/compare/7.10.1...7.11.0
https://github.com/elastic/elasticsearch-net/compare/7.10.1...7.11.0
IndicesOptions. This now supports an IEnumerable<ExpandWildcards> rather than a singular ExpandWildcards value for the "ExpandWildcards" property. When using the Object Initializer syntax, where indices options are set, you will need to update your code to include the ExpandWildcards in an IEnumerable form. When using the Fluent syntax, you existing code should continue to function without changes. When handling a response from the GET Watch API, you will need to handle the "ExpandWildcards" property as an IEnumerable.Lower and Upper properties.EnablePositionIncrements property to ITokenCountProperty (issue: #5186)X-Elastic-Client-Meta HTTP header which is used by Elastic Cloud and can be disabled with the DisableMetaHeader property on the ConnectionConfiguration set to false.ResourceName on AttachmentProcessor (issue: #5198)AllowDuplicates property to AppendProcessor (issue: #5198)https://github.com/elastic/elasticsearch-net/compare/7.10.0...7.10.1
https://github.com/elastic/elasticsearch-net/compare/7.10.0...7.10.1
GetRole, GetRoleAsync, GetRoleMapping and GetRoleMappingAsync APIs have been updated to support using the Names parameter, rather than Name. In the majority of cases, this should be non-breaking because the types support implicit casting. Reflection based usage will be affected. We have review this change and feel it is preferable that the API correctly support specifying multiple, comma separated names.
https://github.com/elastic/elasticsearch-net/compare/7.9.0...7.10.0
https://github.com/elastic/elasticsearch-net/compare/7.9.0...7.10.0
data_* roles.https://github.com/elastic/elasticsearch-net/compare/7.8.2...7.9.0
https://github.com/elastic/elasticsearch-net/compare/7.8.2...7.9.0
https://github.com/elastic/elasticsearch-net/compare/7.8.2...7.9.0-alpha1
https://github.com/elastic/elasticsearch-net/compare/7.8.2...7.9.0-alpha1
Modelling of contexts was incorrectly implemented such that deserialization would fail. This breaking change fixes an implementation that would never…
https://github.com/elastic/elasticsearch-net/compare/7.8.1...7.8.2
client.Timeout was not being set after refactoring introduced in #4673Enum.Parse as case insensitive (issue: #4817)_cleanupTimer is not null when disposing RequestDataHttpClientFactory (issue: #4818)#4854 Fix ScriptCacheStats
Modelling of contexts was incorrectly implemented such that deserialization would fail. This breaking change fixes an implementation that would never have worked.
#4856 Fix DateHistogram aggregation intervals (issue: #4839)
FixedInterval was incorrectly mapped to accept either a DateInterval or Time, but an input always requires a factor, meaning the former input would result in an error from Elasticsearch if used. Rather than attempt to patch around this, we decided to fix the broken implementation such that
FixedInterval accepts only TimeCalendarInterval accepts DateInterval or DateMathTimehttps://github.com/elastic/elasticsearch-net/compare/7.8.0...7.8.1
https://github.com/elastic/elasticsearch-net/compare/7.8.0...7.8.1
https://github.com/elastic/elasticsearch-net/compare/7.7.1...7.8.0
https://github.com/elastic/elasticsearch-net/compare/7.7.1...7.8.0
https://github.com/elastic/elasticsearch-net/compare/7.7.0...7.7.1
https://github.com/elastic/elasticsearch-net/compare/7.7.0...7.7.1
Some generated types and methods for async search and transform APIs made their way into 7.7.0 when they shouldn't have. These types and methods have been removed or their signature changed in 7.7.1:
-Elasticsearch.Net.Specification.DataFrameApi.DeleteDataFrameTransformRequestParameters
-Elasticsearch.Net.Specification.DataFrameApi.GetDataFrameTransformRequestParameters
-Elasticsearch.Net.Specification.DataFrameApi.GetDataFrameTransformStatsRequestParameters
-Elasticsearch.Net.Specification.DataFrameApi.PreviewDataFrameTransformRequestParameters
-Elasticsearch.Net.Specification.DataFrameApi.PutDataFrameTransformRequestParameters
-Elasticsearch.Net.Specification.DataFrameApi.StartDataFrameTransformRequestParameters
-Elasticsearch.Net.Specification.DataFrameApi.StopDataFrameTransformRequestParameters
-Elasticsearch.Net.Specification.DataFrameApi.UpdateDataFrameTransformRequestParameters
+Elasticsearch.Net.Specification.AsyncSearchApi.LowLevelAsyncSearchNamespace.Delete<TResponse>(String, AsyncSearchDeleteRequestParameters)
-Elasticsearch.Net.Specification.AsyncSearchApi.LowLevelAsyncSearchNamespace.Delete<TResponse>(String, DeleteRequestParameters)
+Elasticsearch.Net.Specification.AsyncSearchApi.LowLevelAsyncSearchNamespace.DeleteAsync<TResponse>(String, AsyncSearchDeleteRequestParameters, CancellationToken)
-Elasticsearch.Net.Specification.AsyncSearchApi.LowLevelAsyncSearchNamespace.DeleteAsync<TResponse>(String, DeleteRequestParameters, CancellationToken)
+Elasticsearch.Net.Specification.AsyncSearchApi.LowLevelAsyncSearchNamespace.Get<TResponse>(String, AsyncSearchGetRequestParameters)
-Elasticsearch.Net.Specification.AsyncSearchApi.LowLevelAsyncSearchNamespace.Get<TResponse>(String, GetRequestParameters)
+Elasticsearch.Net.Specification.AsyncSearchApi.LowLevelAsyncSearchNamespace.GetAsync<TResponse>(String, AsyncSearchGetRequestParameters, CancellationToken)
-Elasticsearch.Net.Specification.AsyncSearchApi.LowLevelAsyncSearchNamespace.GetAsync<TResponse>(String, GetRequestParameters, CancellationToken)
+Elasticsearch.Net.Specification.AsyncSearchApi.LowLevelAsyncSearchNamespace.Submit<TResponse>(PostData, AsyncSearchSubmitRequestParameters)
-Elasticsearch.Net.Specification.AsyncSearchApi.LowLevelAsyncSearchNamespace.Submit<TResponse>(PostData, SubmitRequestParameters)
+Elasticsearch.Net.Specification.AsyncSearchApi.LowLevelAsyncSearchNamespace.Submit<TResponse>(String, PostData, AsyncSearchSubmitRequestParameters)
-Elasticsearch.Net.Specification.AsyncSearchApi.LowLevelAsyncSearchNamespace.Submit<TResponse>(String, PostData, SubmitRequestParameters)
+Elasticsearch.Net.Specification.AsyncSearchApi.LowLevelAsyncSearchNamespace.SubmitAsync<TResponse>(PostData, AsyncSearchSubmitRequestParameters, CancellationToken)
-Elasticsearch.Net.Specification.AsyncSearchApi.LowLevelAsyncSearchNamespace.SubmitAsync<TResponse>(PostData, SubmitRequestParameters, CancellationToken)
+Elasticsearch.Net.Specification.AsyncSearchApi.LowLevelAsyncSearchNamespace.SubmitAsync<TResponse>(String, PostData, AsyncSearchSubmitRequestParameters, CancellationToken)
-Elasticsearch.Net.Specification.AsyncSearchApi.LowLevelAsyncSearchNamespace.SubmitAsync<TResponse>(String, PostData, SubmitRequestParameters, CancellationToken)
https://github.com/elastic/elasticsearch-net/compare/7.6.2...7.7.0
https://github.com/elastic/elasticsearch-net/compare/7.6.2...7.7.0
params modifier for methods in RequestDescriptorBase (issue: #4471)https://github.com/elastic/elasticsearch-net/compare/7.6.1...7.6.2
https://github.com/elastic/elasticsearch-net/compare/7.6.1...7.6.2
int -> string (issue: #4537)IPercentageScoreHeuristic on PercentageScoreHeuristic (issue: #4573)"max_children" to Nested Sort (issue: #4595)int to long (issue: #4578)https://github.com/elastic/elasticsearch-net/compare/7.6.0...7.6.1
https://github.com/elastic/elasticsearch-net/compare/7.6.0...7.6.1
https://github.com/elastic/elasticsearch-net/compare/7.5.1...7.6.0
https://github.com/elastic/elasticsearch-net/compare/7.5.1...7.6.0
https://github.com/elastic/elasticsearch-net/compare/7.5.0...7.5.1
https://github.com/elastic/elasticsearch-net/compare/7.5.0...7.5.1
PUT for all index requests. For index requests with an Id this is not valid. In the past we always generated POST which is also not totally correct but the server accepted this. This was only happening in the low level client and only for 7.5.0.https://github.com/elastic/elasticsearch-net/compare/7.4.2...7.5.0
https://github.com/elastic/elasticsearch-net/compare/7.4.2...7.5.0
https://github.com/elastic/elasticsearch-net/compare/7.4.1...7.4.2
https://github.com/elastic/elasticsearch-net/compare/7.4.1...7.4.2
#4260 .NET ElasticLowLevelClient 7.4.1 serializer extremely slow (PR: #4263)
We strongly recommend that all 7.x version users that use the low level client with ConnectionConfiguration, update the client to this version, 7.4.2, to receive this bug fix to serialization performance. Thank you @ewolfman for reporting with a reproduction 👍
Whilst removing them in a patch release is technically a breaking change, they would never have been able to be used, because types were generated und…
https://github.com/elastic/elasticsearch-net/compare/7.4.0...7.4.1
pipeline to ReindexDestination for ReindexOnServer (#4183). Thanks @andrx 👍doc_count (#4214)DynamicResponse not parsing when mimetype contains charsetIProperty implementations (#4219)#4182 Remove redundant SLM types.
These types were mistakenly included in 7.4.0, generated under an Slm namespace. Whilst removing them in a patch release is technically a breaking change, they would never have been able to be used, because types were generated under a SnapshotLifecycleManagement namespace in 7.4.0.
elasticsearch.org with elastic.cohttps://github.com/elastic/elasticsearch-net/compare/7.3.1...7.4.0
https://github.com/elastic/elasticsearch-net/compare/7.3.1...7.4.0
KeyedBucket<TKey>.docvalue_fields to SuggestOption. #4148 Thanks @Treno1 👍https://github.com/elastic/elasticsearch-net/compare/7.3.0...7.3.1
https://github.com/elastic/elasticsearch-net/compare/7.3.0...7.3.1
DebugInformation uri and method from Request or ApiCallDetails (#3687)[PropertyName("name", Ignore=true)] ignore not honoured.GeoSuggest. Thanks @khalidabuhakmeh 👍Flags property to PatternReplaceCharFilter. Thanks @awelburn 👍PatternReplaceTokenFilter Flags propertyhttps://github.com/elastic/elasticsearch-net/compare/7.2.1...7.3.0
https://github.com/elastic/elasticsearch-net/compare/7.2.1...7.3.0
search_as_you_type field type and bool_prefix query typeminimum_interval to AutoDateHistogram aggregationRareTerms aggregation"flattened" datatypeIntervals queryFollowerAliasesVersion to follow index shard statsvoting_only to ClusterNodeStats and XPackInfoXPackUsage and XPackInfo responsesshards_acknowledged and indices results to CloseIndexResponseforeachSourceOnly snapshot repositoryCommonTerms query and CutoffFrequency of Match querymax_docs to ReindexOnServer API and deprecate sizeCultureInfo.InvariantCulture when falling back to parsing doubleStringTimeSpanAttribute to serialize TimeSpan as stringshttps://github.com/elastic/elasticsearch-net/compare/7.2.0...7.2.1
https://github.com/elastic/elasticsearch-net/compare/7.2.0...7.2.1
item.Name instead of Enum.GetName() to get enum name. Thank you @sklirg 👍https://github.com/elastic/elasticsearch-net/compare/7.1.0...7.2.0
https://github.com/elastic/elasticsearch-net/compare/7.1.0...7.2.0
NodeStatisticsif_seq_no and if_primary_term in the bulk update requestGetTaskResponse does not expose Failures for reindex taskResponse on GetTaskResponseDebuggerDisplay override ToStringCloudConnectionPoolif_seq_no and if_primary_term to bulk updates.DateRangeAggregationBulkAll() improvementsBulkAll() requires DefaultIndex or DefaultMappingFor with indexAuditTrail integration assertion fixpackaging to cluster stats response.created_by info to usage stats.[Obsolete] attributes as required.Indices.Exists fails in Full .NET framework, works in .NET CoreJsonNetSerializer doesn't work for GeoLocationGeoLocationFormatter returns GeoLocation typehttps://github.com/elastic/elasticsearch-net/compare/7.0.1...7.1.0
https://github.com/elastic/elasticsearch-net/compare/7.0.1...7.1.0
GeoTileGrid aggregationdate_nanos type implementationadjust_offsets on word delimiter graph token filterrank_feature, rank_features field datatypes and rank_feature queryDateMath no longer serializes time zone information for local DateTimeweight parameter in script_score resulted in an invalid requestTypeMappingDescriptor<T> still supports setting AllFieldTrackTotalHits is ignored during MultiSearch callUseSocketsHttpHandler fixscript_score functionDateTimeKindtrack_total_hits to search request bodyAllField and IndexFieldGeoshapeJsonSerializerSettings not honored for Field ExpressionsIPropertyMappingProvider on custom IElastisearchSerializerSystem.Diagnostics.DiagnosticSource nuget package.System.Diagnostics.DiagnosticSource reference for NetStandard 2.0Transfer-Encoding: chunked is enabled by defaulthttps://github.com/elastic/elasticsearch-net/compare/7.0.0...7.0.1
https://github.com/elastic/elasticsearch-net/compare/7.0.0...7.0.1
Please refer to the documentation for a full list of public API breaking changes between 6.8.0 and 7.0.0 GA releases.
https://github.com/elastic/elasticsearch-net/compare/7.0.0-beta1...7.0.0
After many months of work, two alphas and a beta, we are pleased to announce the GA release of the NEST and Elasticsearch.Net 7.0 clients.
The overall themes of this release have been based around faster serialization, performance improvements, codebase simplification, and ensuring parity with the many new features available in Elasticsearch 7.0.
Specifying types within the .NET clients is now deprecated in 7.0, in line with the overall Elasticsearch type removal strategy.
In instances where your index contains type information and you need to preserve this information, one recommendation is to introduce a property to describe the document type (similar to a table per class with discriminator field in the ORM world) and then implement a custom serialization / deserialization implementation for that class.
This Elasticsearch page details some other approaches.
After internalizing the serialization routines, and IL-merging the Newtonsoft.Json package in 6.x, we are pleased to announce that the next stage of serialization improvements have been completed in 7.0.
Both SimpleJson and Newtonsoft.Json have been completely removed and replaced with an implementation of Utf8Json, a fast serializer that works directly with UTF-8 binary. This has yielded a significant performance improvement, which we will be sharing in more detail in a later blog post.
With the move to Utf8Json, we have removed some features that were available in the previous JSON libraries that have proven too onerous to carry forward at this stage.
JSON in the request is never indented, even if SerializationFormatting.Indented is specified. The serialization routines generated by Utf8Json never generate an IJsonFormatter<T> that will indent JSON, for performance reasons. We are considering options for exposing indented JSON for development and debugging purposes.
NEST types cannot be extended by inheritance. With NEST 6.x, additional properties can be included for a type by deriving from that type and annotating these new properties. With the current implementation of serialization with Utf8Json, this approach will not work.
Serializer uses Reflection.Emit. Utf8Json uses Reflection.Emit to generate efficient formatters for serializing types that it sees. Reflection.Emit is not supported on all platforms, for example, UWP, Xamarin.iOS, and Xamarin.Android.
Elasticsearch.Net.DynamicResponse deserializes JSON arrays to List<object>. SimpleJson deserialized JSON arrays to object[], but Utf8Json deserializes them to List<object>. This change is preferred for allocation and performance reasons.
Utf8Json is much stricter when deserializing JSON object field names to C# POCO properties. With the internal Json.NET serializer in 6.x, JSON object field names would attempt to be matched with C# POCO property names first by an exact match, falling back to a case insensitive match. With Utf8Json in 7.x however, JSON object field names must match exactly the name configured for the C# POCO property name.
We believe that the trade-off of features vs. GA release has been worthwhile at this stage. We hold a view to address some of these missing features in a later release.
In 6.x, the process of an API call within NEST looked roughly like this
client.Search()
=> Dispatch()
=> LowLevelDispatch.SearchDispatch()
=> lowlevelClient.Search()
=> lowlevelClient.DoRequest()
With 7.x, this process has been changed to remove dispatching to the low-level client methods. The new process looks like this
client.Search()
=> lowlevelClient.DoRequest()
This means that in the high-level client IRequest now builds its own URLs, with the upside that the call chain is shorter and allocates fewer closures. The downside is that there are now two URL building mechanisms, one in the low-level client and a new one in the high-level client. In practice, this area of the codebase is kept up to date via code generation, so it does not place any additional burden on development.
Given the simplified call chain and debugging experience, we believe this is an improvement worth making.
As the API surface of Elasticsearch has grown to well over 200 endpoints, so has the number of client methods exposed, leading to an almost overwhelming number to navigate and explore through in an IDE. This is further exacerbated by the fact that the .NET client exposes both synchronous and asynchronous API methods for both the fluent API syntax as well as the object initializer syntax.
To address this, the APIs are now accessible through sub-properties on the client instance.
For example, in 6.x, to create a machine learning job
var putJobResponse = client.PutJob<Metric>("id", c => c
.Description("Lab 1 - Simple example")
.ResultsIndexName("server-metrics")
.AnalysisConfig(a => a
.BucketSpan("30m")
.Latency("0s")
.Detectors(d => d.Sum(c => c.FieldName(r => r.Total)))
)
.DataDescription(d => d.TimeField(r => r.Timestamp))
);
This has changed to
var putJobResponse = client.MachineLearning.PutJob<Metric>("id", c => c
.Description("Lab 1 - Simple example")
.ResultsIndexName("server-metrics")
.AnalysisConfig(a => a
.BucketSpan("30m")
.Latency("0s")
.Detectors(d => d.Sum(c => c.FieldName(r => r.Total)))
)
.DataDescription(d => d.TimeField(r => r.Timestamp))
);
Notice the client.MachineLearning.PutJob method call in 7.0, as opposed to client.PutJob in 6.x.
We believe this grouping of functionality leads to a better discoverability experience when writing your code, and improved readability when reviewing somebody else's.
To assist developers in migrating from 6.x, we have published the Nest.7xUpgradeAssistant Nuget package. When included in your project and the using Nest.ElasticClientExtensions; directive is added, calls will be redirected from the old API method names to the new API method names in 7.0. The result is that your project will compile and you won't need to immediately update your code to use the namespaced methods; instead you'll see compiler warnings indicating the location of the new API methods in 7.0.
This package is to assist developers migrating from 6.x to 7.0 and is limited in scope to this purpose. It is recommended that you observe the compiler warnings and adjust your code as indicated.
7.0 introduces emitting System.Diagnostics.DiagnosticSource information from the client, during a request. The goal is to enable rich information exchange with the Elastic APM .NET agent and other monitoring libraries.
We emit DiagnosticSource information for key parts of a client request via an Activity event, shipping support for Id, ParentId, RootId, as well as request Duration.
To facilitate wiring this up to DiagnosticListener.AllListeners, we ship both with static access to the publisher names and events through Elasticsearch.Net.Diagnostics.DiagnosticSources as well as strongly typed listeners, removing the need to cast the object passed to activity start/stop events.
An example listener implementation that writes events to the console is given below
private class ListenerObserver : IObserver<DiagnosticListener>
{
public void OnCompleted() => Console.WriteLine("Completed");
public void OnError(Exception error) => Console.Error.WriteLine(error.Message);
public void OnNext(DiagnosticListener value)
{
void WriteToConsole<T>(string eventName, T data)
{
var a = Activity.Current;
Console.WriteLine($"{eventName?.PadRight(30)} {a.Id?.PadRight(32)} {a.ParentId?.PadRight(32)} {data?.ToString().PadRight(10)}");
}
if (value.Name == DiagnosticSources.AuditTrailEvents.SourceName)
value.Subscribe(new AuditDiagnosticObserver(v => WriteToConsole(v.Key, v.Value)));
if (value.Name == DiagnosticSources.RequestPipeline.SourceName)
value.Subscribe(new RequestPipelineDiagnosticObserver(
v => WriteToConsole(v.Key, v.Value),
v => WriteToConsole(v.Key, v.Value))
);
if (value.Name == DiagnosticSources.HttpConnection.SourceName)
value.Subscribe(new HttpConnectionDiagnosticObserver(
v => WriteToConsole(v.Key, v.Value),
v => WriteToConsole(v.Key, v.Value)
));
if (value.Name == DiagnosticSources.Serializer.SourceName)
value.Subscribe(new SerializerDiagnosticObserver(v => WriteToConsole(v.Key, v.Value)));
}
}
Using the following example
var pool = new SniffingConnectionPool(new[] { node.NodesUris().First() });
var settings = new ConnectionSettings(pool).SniffOnStartup();
var client = new ElasticClient(settings);
var x = client.Search<object>(s=>s.AllIndices());
Console.WriteLine(new string('-', Console.WindowWidth - 1));
var y = client.Search<object>(s=>s.Index("does-not-exist"));
Emits the following console output:
SniffOnStartup.Start |59e275e-4f9c835d189eb14a. Event: SniffOnStartup
Sniff.Start |59e275e-4f9c835d189eb14a.1. |59e275e-4f9c835d189eb14a. GET _nodes/http,settings
Sniff.Start |59e275e-4f9c835d189eb14a.1.1. |59e275e-4f9c835d189eb14a.1. GET _nodes/http,settings
SendAndReceiveHeaders.Start |59e275e-4f9c835d189eb14a.1.1.1. |59e275e-4f9c835d189eb14a.1.1. GET _nodes/http,settings
SendAndReceiveHeaders.Stop |59e275e-4f9c835d189eb14a.1.1.1. |59e275e-4f9c835d189eb14a.1.1. 200
ReceiveBody.Start |59e275e-4f9c835d189eb14a.1.1.2. |59e275e-4f9c835d189eb14a.1.1. GET _nodes/http,settings
Deserialize.Start |59e275e-4f9c835d189eb14a.1.1.2.1. |59e275e-4f9c835d189eb14a.1.1.2. request/response: Nest.DefaultHighLevelSerializer
Deserialize.Stop |59e275e-4f9c835d189eb14a.1.1.2.1. |59e275e-4f9c835d189eb14a.1.1.2. request/response: Nest.DefaultHighLevelSerializer
ReceiveBody.Stop |59e275e-4f9c835d189eb14a.1.1.2. |59e275e-4f9c835d189eb14a.1.1. 200
Sniff.Stop |59e275e-4f9c835d189eb14a.1.1. |59e275e-4f9c835d189eb14a.1. GET _nodes/http,settings
Sniff.Stop |59e275e-4f9c835d189eb14a.1. |59e275e-4f9c835d189eb14a. Successful low level call on GET: /_nodes/http,settings?timeout=2s&flat_settings=true
SniffOnStartup.Stop |59e275e-4f9c835d189eb14a. Event: SniffOnStartup Took: 00:00:00.1872459
Ping.Start |59e275f-4f9c835d189eb14a. HEAD /
SendAndReceiveHeaders.Start |59e275f-4f9c835d189eb14a.1. |59e275f-4f9c835d189eb14a. HEAD /
SendAndReceiveHeaders.Stop |59e275f-4f9c835d189eb14a.1. |59e275f-4f9c835d189eb14a. 200
ReceiveBody.Start |59e275f-4f9c835d189eb14a.2. |59e275f-4f9c835d189eb14a. HEAD /
ReceiveBody.Stop |59e275f-4f9c835d189eb14a.2. |59e275f-4f9c835d189eb14a. 200
Ping.Stop |59e275f-4f9c835d189eb14a. Successful low level call on HEAD: /
CallElasticsearch.Start |59e2760-4f9c835d189eb14a. POST _all/_search
SendAndReceiveHeaders.Start |59e2760-4f9c835d189eb14a.1. |59e2760-4f9c835d189eb14a. POST _all/_search
Serialize.Start |59e2760-4f9c835d189eb14a.1.1. |59e2760-4f9c835d189eb14a.1. request/response: Nest.DefaultHighLevelSerializer
Serialize.Stop |59e2760-4f9c835d189eb14a.1.1. |59e2760-4f9c835d189eb14a.1. request/response: Nest.DefaultHighLevelSerializer
SendAndReceiveHeaders.Stop |59e2760-4f9c835d189eb14a.1. |59e2760-4f9c835d189eb14a. 200
ReceiveBody.Start |59e2760-4f9c835d189eb14a.2. |59e2760-4f9c835d189eb14a. POST _all/_search
Deserialize.Start |59e2760-4f9c835d189eb14a.2.1. |59e2760-4f9c835d189eb14a.2. request/response: Nest.DefaultHighLevelSerializer
Deserialize.Stop |59e2760-4f9c835d189eb14a.2.1. |59e2760-4f9c835d189eb14a.2. request/response: Nest.DefaultHighLevelSerializer
ReceiveBody.Stop |59e2760-4f9c835d189eb14a.2. |59e2760-4f9c835d189eb14a. 200
CallElasticsearch.Stop |59e2760-4f9c835d189eb14a. Successful low level call on POST: /_all/_search?typed_keys=true
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
CallElasticsearch.Start |59e2761-4f9c835d189eb14a. POST does-not-exist/_search
SendAndReceiveHeaders.Start |59e2761-4f9c835d189eb14a.1. |59e2761-4f9c835d189eb14a. POST does-not-exist/_search
Serialize.Start |59e2761-4f9c835d189eb14a.1.1. |59e2761-4f9c835d189eb14a.1. request/response: Nest.DefaultHighLevelSerializer
Serialize.Stop |59e2761-4f9c835d189eb14a.1.1. |59e2761-4f9c835d189eb14a.1. request/response: Nest.DefaultHighLevelSerializer
SendAndReceiveHeaders.Stop |59e2761-4f9c835d189eb14a.1. |59e2761-4f9c835d189eb14a. 404
ReceiveBody.Start |59e2761-4f9c835d189eb14a.2. |59e2761-4f9c835d189eb14a. POST does-not-exist/_search
Deserialize.Start |59e2761-4f9c835d189eb14a.2.1. |59e2761-4f9c835d189eb14a.2. request/response: Nest.DefaultHighLevelSerializer
Deserialize.Stop |59e2761-4f9c835d189eb14a.2.1. |59e2761-4f9c835d189eb14a.2. request/response: Nest.DefaultHighLevelSerializer
ReceiveBody.Stop |59e2761-4f9c835d189eb14a.2. |59e2761-4f9c835d189eb14a. 404
CallElasticsearch.Stop |59e2761-4f9c835d189eb14a. Unsuccessful low level call on POST: /does-not-exist/_search?typed_keys=true
Most API methods now return classes and not interfaces; for example, the client method client.Cat.Help now returns a CatResponse<CatAliasesRecord> as opposed to an interface named ICatResponse<CatAliasesRecord>.
In instances where methods can benefit from returning an interface, these have been left intact, for example, ISearchResponse<T>.
So why make the change?
Firstly, this significantly reduces the number of types in the library, reducing the overall download size, improving assembly load times and eventually the execution.
Secondly, it removes the need for us to manage the conversion of a Task<Response> to Task<IResponse>, a somewhat awkward part of the request pipeline.
The downside is that it does make it somewhat more difficult to create mocks / stubs of responses in the client.
After lengthy discussion we decided that users can achieve a similar result using a JSON string and the InMemoryConnection available in Elasticsearch.Net. We use this technique extensively in the Tests.Reproduce project.
Another alternative would be to introduce an intermediate layer in your application, and conceal the client calls and objects within that layer so they can be mocked.
IApiCallDetails.Success and ResponseBase.IsValid have been simplified, making it easier to inspect if a request to Elasticsearch was indeed successful or not.
If the status code from Elasticsearch is 2xx then .Success will be true. In instances where a 404 status code is received, for example if a GET request results in a missing document, then .Success will be false. This is also the case for HEAD requests that result in a 404.
This is controlled via IConnectionConfiguration.StatusCodeToResponseSuccess, which currently has no public setter.
The NEST high level client overrides StatusCodeToResponseSuccess, whereby 404 status codes now sets .Success as true.
The reasoning here is that because NEST is in full control of url and path building the only instances where a 404 is received is in the case of a missing document, never from a missing endpoint.
However, in the case of a 404 the ResponseBase.IsValid property will be false.
It has the nice side effect that if you set .ThrowExceptions() and perform an action on an entity that does not exist it won't throw as .ThrowExceptions() only inspects .Success on ApiCallDetails.
Please refer to the documentation for a full list of public API breaking changes between 6.8.0 and 7.0.0 GA releases.
HighlightFieldDictionary to use formatterGenericProperty.Index to `bool?``after_key Dictionary when aggregatingCultureInfo.InvariantCulture`` when writing values in GeoWKTWriter``Marshal.SecureStringToGlobalAllocUnicodeCatHelp and NodeHotThreads integration tests due to mimetype mismatchResponseBuilder mimeType check is too strict on net461 frameworkValueTuple and ValueTask dependenciesdoc usedPostData contained serializable routines instead of SerializableDataGeoOrientation to tolerate alternative server optionsIsValid=false for 404 responseTotalHitsSynchronizedCollection was removeddouble values should always be serialized with a decimal pointutf8json should match SimpleJsonIMemoryStreamFactory was being side stepped in some placesHttpMessageHandler on HttpConnectionIAcknowledgedResponse implementation from IRevertModelSnapshotResponseGeoUnit to Unit on SortGeoDistanceXamarin.iOS NSUrlSessionHandler for HTTPgeo_shape supportutf8json as the internal serializerScript query to use IScript property, and IScript on ScriptQueryIpRangeBucket for IpRangeAggregationIPRangeBucket type for IpRange aggregationfloat? for Suggester fractional propertiesName and Id parametersServerError, Error and ErrorCauseSecureString for Basic and Proxy authentication passwordsSerializeToString and SerializeToBytesICreateIndexResponsedelimited_payload_filter name in deserializationSimilarity from enum to stringHighlightDocumentDictionary and HighlightHitICovariantSearchRequest to ISearchTypeInformationDocCount no longer nullable on matrix stats aggregationShould implementation explicitSystem.DiagnosticSource dependancy to nuspec fileutf8jsonis_write_indexafter_key Dictionary when aggregatingSequenceNumber and PrimaryTerm to Hits, Get and MulitGetHitindex.analyze.max_token_count to updateable index settingstook time to _msearchCat Threadpool propertieshttps://github.com/elastic/elasticsearch-net/compare/7.0.0-alpha2...7.0.0-beta1
https://github.com/elastic/elasticsearch-net/compare/7.0.0-alpha2...7.0.0-beta1
Following the advice given in 7.0.0-alpha1 the namespacing change has been implemented for this release.
In both Elasticsearch.Net and NEST clients, API methods are made available on the root of the client. As the API surface of Elasticsearch has grown to well over 200 endpoints, so has the number of API methods exposed, leading to an almost overwhelming number of methods to navigate through to choose the method aligning with the desired API call. This is further exacerbated by the fact that the client exposes synchronous and asynchronous API methods for both the fluent API syntax as well as the object initializer syntax.
To address this, the APIs are now accessible through sub-properties on the client instance.
For example, in 6.x, to create a Machine Learning job the code is:
var putJobResponse = client.PutJob<Metric>("id", c => c
.Description("Lab 1 - Simple example")
.ResultsIndexName("server-metrics")
.AnalysisConfig(a => a
.BucketSpan("30m")
.Detectors(d => d.Sum(c => c.FieldName(r => r.Total)))
)
.DataDescription(d => d.TimeField(r => r.Timestamp));
);
This has changed to:
var putJobResponse = client.MachineLearning.PutJob<Metric>("id", c => c
.Description("Lab 1 - Simple example")
.ResultsIndexName("server-metrics")
.AnalysisConfig(a => a
.BucketSpan("30m")
.Detectors(d => d.Sum(c => c.FieldName(r => r.Total)))
)
.DataDescription(d => d.TimeField(r => r.Timestamp));
);
Notice the client.MachineLearning.PutJob method call in 7.0.0-beta1, as opposed to client.PutJob in 6.x
This is another alpha release of the .NET client, as we move a step closer to GA. Thank you for all your feedback on the 7.0.0-alpha1 client, it has b
This is another alpha release of the .NET client, as we move a step closer to GA. Thank you for all your feedback on the 7.0.0-alpha1 client, it has been incredibly helpful in squashing bugs in the new serializer implementation.
https://github.com/elastic/elasticsearch-net/compare/7.0.0-alpha1...7.0.0-alpha2
#3670 Majority of response interfaces are gone
This reduces the interface type explosion within the client and simplifies the async API code paths. There is a discussion to keep interfaces for the most commonly mocked responses, like ISearchResponse<T>
#3685 Strongly typed property expressions
Benchmarking demonstrates a performance improvement in using Expression<Func<T, TValue>> instead of `Expression<Func<T, object>>, particularly on .NET Framework.
MoreLikeThis query conditionless behaviourThis is the first alpha prerelease of the client with support for Elasticsearch 7.x to Nuget.
This is the first alpha prerelease of the client with support for Elasticsearch 7.x to Nuget.
The intention in releasing this package now is to elicit feedback from the community on some of the larger changes that have already gone into the 7.x branch, prior to putting out a GA release. Some of the large changes include:
Following discussion and research with replacing Json.NET as the internal serializer, a fork of Utf8Json is source included into Elasticsearch.NET, replacing both the lowlevel serializer based on SimpleJson, and the high level serializer based on Json.NET. Early research indicated about a 2x performance improvement in serialization.
All unit tests and integration tests are passing with this new serializer, but there are some known existing features of the client that will not yet work:
#3654 JSON serialization is never indented, even if SerializationFormatting.Indented is specified
The serialization routines generated by Utf8Json never generate IJsonFormatter<T> that will indent JSON, for performance reasons. We expect to implement this feature in a later release.
#3655 NEST types cannot be extended by inheritance
With NEST 6.x, additional properties can be included for a type by deriving from that type and annotating these new properties. With the current implementation of serialization with Utf8Json, this approach will not work. We expect to implement this in a later release.
Serializer uses Reflection.Emit
Utf8Json uses Reflection.Emit to generate efficient formatters for serializing types that it sees. Reflection.Emit is not supported on all platforms e.g. UWP, Xamarin.iOS, Xamarin.Android.
Elasticsearch.Net.DynamicResponse deserializes JSON arrays to List<object>
SimpleJson deserialized JSON arrays to object[], but Utf8Json deserializes them to List<object>. We believe that that the change to returning List<object> would be preferred for allocation and performance reasons.
In 6.x, the process of an API call within NEST looked roughly like
client.Search()
=> Dispatch()
=> LowLevelDispatch.SearchDispatch()
=> lowlevelClient.Search()
=> lowlevelClient.DoRequest()
With 7.x, this process has been changed to remove dispatching to the low level client methods and the middle layer. The new process looks like
client.Search()
=> lowlevelClient.DoRequest()
This means that in the high level client IRequest now does it own url building, with the upside that the call chain is smaller and allocates a fewer lambda closures. The downside is that there are now 2 url building mechanisms, one in the low level client and a new one in the high level client, but we think this trade off is worth it.
geo_shape queries and geoshapesSupport for geo_shape queries has existed in NEST for a long time, but each geoshape had its own query type and API method to use to make a geo_shape query. With 7.x, these have all been refactored into one query, GeoShapeQuery, that accepts an IGeoShape, the shape to use within the query.
We would love to get feedback from folks trying out the 7.0.0-alpha1 release of the client. If you come across an exception or bug, please open an issue to discuss.
https://github.com/elastic/elasticsearch-net/compare/6.8.10...6.8.11
https://github.com/elastic/elasticsearch-net/compare/6.8.10...6.8.11
https://github.com/elastic/elasticsearch-net/compare/6.8.9...6.8.10
https://github.com/elastic/elasticsearch-net/compare/6.8.9...6.8.10
https://github.com/elastic/elasticsearch-net/compare/6.8.8...6.8.9
https://github.com/elastic/elasticsearch-net/compare/6.8.8...6.8.9
https://github.com/elastic/elasticsearch-net/compare/6.8.7...6.8.8
https://github.com/elastic/elasticsearch-net/compare/6.8.7...6.8.8
https://github.com/elastic/elasticsearch-net/compare/6.8.6...6.8.7
https://github.com/elastic/elasticsearch-net/compare/6.8.6...6.8.7
https://github.com/elastic/elasticsearch-net/compare/6.8.5...6.8.6
https://github.com/elastic/elasticsearch-net/compare/6.8.5...6.8.6
https://github.com/elastic/elasticsearch-net/compare/6.8.4...6.8.5
https://github.com/elastic/elasticsearch-net/compare/6.8.4...6.8.5
https://github.com/elastic/elasticsearch-net/compare/6.8.3...6.8.4
https://github.com/elastic/elasticsearch-net/compare/6.8.3...6.8.4
https://github.com/elastic/elasticsearch-net/compare/6.8.2...6.8.3
https://github.com/elastic/elasticsearch-net/compare/6.8.2...6.8.3
Flags property to PatternReplaceCharFilter. Thanks @awelburn 👍PatternReplaceTokenFilter Flags propertyhttps://github.com/elastic/elasticsearch-net/compare/6.8.1...6.8.2
https://github.com/elastic/elasticsearch-net/compare/6.8.1...6.8.2
CloudConnectionPool IConnectionPool type
This makes it easier than ever to work with Elasticsearch service on Elastic Cloud 🎉DebuggerDisplay override ToString()if_seq_no and if_primary_term to bulk updates.GeoLocation with internal serializerBulkAll() improvementshttps://github.com/elastic/elasticsearch-net/compare/6.8.0...6.8.1
https://github.com/elastic/elasticsearch-net/compare/6.8.0...6.8.1
https://github.com/elastic/elasticsearch-net/compare/6.7.0...6.8.0
https://github.com/elastic/elasticsearch-net/compare/6.7.0...6.8.0
Major feature highlights include support for the Security Api Keys and Index Lifecycle Management endpoints.
Major feature highlights include support for the Security Api Keys and Index Lifecycle Management endpoints.
https://github.com/elastic/elasticsearch-net/compare/6.6.0...6.7.0
is_write_index for the create index API - thanks @kpstolk 👍Fluent.AssignContractJsonConverterAttribute where possiblepragma directivespassword_hash parameter to PutUsergeo_shape types to be coerced into valid shapes.ignore_missing added to all ingest processorsClusterHealthResponse.cs to align with ClusterHealthResponse.java - thanks @SpencerLN 👍ClusterHealthResponse.cs - thanks @SpencerLN 👍https://github.com/elastic/elasticsearch-net/compare/6.5.1...6.6.0
https://github.com/elastic/elasticsearch-net/compare/6.5.1...6.6.0
ConnectionSettingsAwareContractResolver on JsonNetSerializer_cluster on search response"missing" in Composite Aggregationkeywords_pattern in keywords_marker token filternull values with CompositeKey and After() functionalityDateParseHandling.None when loading JObject for MultiGetHit<T>One column per quarter.