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

**URL:** <https://discuss.elastic.co/t/net-elastic-clients-elasticsearch-version-8-13-12-searchasync/366097>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [September 5, 2024, 12:29pm UTC](https://discuss.elastic.co/t/net-elastic-clients-elasticsearch-version-8-13-12-searchasync/366097 "2024-09-05T12:29:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Premysl\_Capek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/premysl_capek/32/132037_2.png) [@Premysl\_Capek](https://discuss.elastic.co/u/Premysl_Capek)\
**Post date:** [September 5, 2024, 12:29pm UTC](https://discuss.elastic.co/t/net-elastic-clients-elasticsearch-version-8-13-12-searchasync/366097/1 "2024-09-05T12:29:19Z")

</div>

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?

```auto
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):

> <https://github.com/elastic/elasticsearch-net/commit/946db96a699dc376fdb8fdaae2632a6fb7658b45>
>
> \- Implement \`IStreamSerializable\` for array request descriptors
> \- Do not automa…tically infer index for optional \`Indices\` parameters
> 
> Co-authored-by: Florian Bernd \<git@flobernd.de\>

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![flobernd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flobernd/32/124877_2.png) [@flobernd](https://discuss.elastic.co/u/flobernd)\
**Post date:** [September 5, 2024, 1:58pm UTC](https://discuss.elastic.co/t/net-elastic-clients-elasticsearch-version-8-13-12-searchasync/366097/2 "2024-09-05T13:58:00Z")

</div>

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](https://github.com/elastic/elasticsearch-net/issues/8215))

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