.NET Elastic.Clients.Elasticsearch (version >= 8.13.12) - SearchAsync

Hi, I have problem with ES client version >= 8.13.12. In past I use this code to get the latest document from an index but in new version I get a document from a different index.

What is correct query for new clients?

var lastTraderx = await _elasticClient.SearchAsync<ETrader>(s => s.Size(1), cancellationToken); //Returns document form a diferent index
        long? lastTraderTimestampx = lastTraderx.IsValidResponse ? lastTraderx.Documents.First().RegistrationTimestamp : null;
        var singleTrader = await _elasticClient.GetAsync<ETrader>(289390, cancellationToken); //Returns document from the correct index

Github change (8.13.12):

Thank you in advance.

Hi @Premysl_Capek ,

SearchAsync currently does not use the configured default index (see Default index is not used in query with 8.13.15 client · Issue #8215 · elastic/elasticsearch-net · GitHub)

For now, you have to manually specify the index when calling SearchAsync by adding s.Index("index") to the descriptor chain.