Whether Nest5.2.0 and ElasticSearch.Net 5.2.0 can support elasticsearch6.7.1 query,aggregation,sort?

currently i use elasticsearch.net 5.2.0 and Nest5.2.0 to call elasticsearch5.4.3 to get the search result, now i prepare to upgrade elasticsearch to version 6.7.1, whether i can use current elasticsearch.net5.2.0 and Nest5.2.0 to call elasticsearch6.7.1? any potential issue for this? or no problem? thanks

Nest 5.x is compatible with Elasticsearch 5.x. If you're upgrading to Elasticsearch 6.x, you'll also need to upgrade NEST to 6.x too

ok, thanks, another question is that why it will take 15 seconds at first time call using elasticsearch.net 6.x search syntax like below:
var searchResponse = lowlevelClient.Search("people", "person", PostData.Serializable(new
from = 0,
size = 10,
query = new
match = new
firstName = "Martijn"

but second time call, it will take 77ms , i don't know why, do i need to do other things to let first time call search can have a short response time?, thanksPreformatted text

The very first call will be slower than others because the client caches a lot of type metadata on the first call that is needed for serialization. If this a problem for your application, you can initiate the first call during client setup, when the application starts.

15 seconds seems like a long time though, how have you measured/benchmarked that all or the majority of this time is spent by the client?

i found that have same issue in github,
https://github.com/elastic/elasticsearch-net/pull/3608,Preformatted text
currently i use elasticsearch.net6.6 and Nest6.6, do i need to use 7.x branch to fix the problem? thanksPreformatted text

This is not the same issue as the one linked. The one linked is about a general performance difference between NEST 5.6.2 and 6.1.0, whereas the issue you describe is about the performance of the first request.

The caching performed on the first request cannot be avoided in the client, because the majority of it is performed by Json.NET, the JSON serializer used by the client. Without this caching, you would pay a performance cost on every request, so it helps all requests after the first one. As I mentioned, if there is an issue with the first request being made to a user initiated action within your application, you could prime the cache ahead of time by making the first request just after instantiating the client.

Moving to 7.x will not change this behaviour much, as the serialized used within 7.x, Utf8Json, adopts similar caching strategies. Most serializers that I have seen in .NET do something similar.

It would be good to know how you are benchmarking/measuring this

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.