# Elastic.Clients.Elasticsearch Support for Update without index name

**URL:** https://discuss.elastic.co/t/elastic-clients-elasticsearch-support-for-update-without-index-name/357794
**Category:** Elasticsearch
**Tags:** language-clients
**Created:** [April 19, 2024, 1:58pm UTC](https://discuss.elastic.co/t/elastic-clients-elasticsearch-support-for-update-without-index-name/357794 "2024-04-19T13:58:50Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![DdeM](https://avatars.discourse-cdn.com/v4/letter/d/b4bc9f/32.png) [@DdeM](https://discuss.elastic.co/u/DdeM)
#### Post date: [April 19, 2024, 1:58pm UTC](https://discuss.elastic.co/t/elastic-clients-elasticsearch-support-for-update-without-index-name/357794/1 "2024-04-19T13:58:50Z")

</div>

Using the .Net client for elasticsearch I can do all actions using a generic contstraint, eg.

```auto
return _client.DeleteAsync<T>(id, cancellationToken);

```

However, when I want to edit a document this doesn't work. Is there a reason for this or am I overlooking something?

eg. I would expect this to use the default mapping for T:

```auto
return _client.UpdateAsync<T>(indexName, id, configureRequest, cancellationToken);

```

---

<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: [April 20, 2024, 8:14pm UTC](https://discuss.elastic.co/t/elastic-clients-elasticsearch-support-for-update-without-index-name/357794/2 "2024-04-20T20:14:10Z")

</div>

Hi @DdeM, this looks like the same bug as in [[DotNet Client] Version 8.13 seems to have removed the ability to use the default index name of a document type? - #3 by flobernd](https://discuss.elastic.co/t/dotnet-client-version-8-13-seems-to-have-removed-the-ability-to-use-the-default-index-name-of-a-document-type/357834/3)

I'll check on Monday 🙂

---

<div class="post-metadata">

### Author: ![DdeM](https://avatars.discourse-cdn.com/v4/letter/d/b4bc9f/32.png) [@DdeM](https://discuss.elastic.co/u/DdeM)
#### Post date: [April 22, 2024, 10:31am UTC](https://discuss.elastic.co/t/elastic-clients-elasticsearch-support-for-update-without-index-name/357794/3 "2024-04-22T10:31:45Z")

</div>

@flobernd Sounds like it indeed. Would be awesome if that can be fixed 🙂 Makes testing a lot easier if I can configure an index name in one place 🙂

---

<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: [April 22, 2024, 11:05am UTC](https://discuss.elastic.co/t/elastic-clients-elasticsearch-support-for-update-without-index-name/357794/4 "2024-04-22T11:05:48Z")

</div>

@DdeM

Fixed in [Generate inference constructor overloads by flobernd · Pull Request #8153 · elastic/elasticsearch-net · GitHub](https://github.com/elastic/elasticsearch-net/pull/8153)

Will be included in the next patch release (today or tomorrow).

Just note, that `Update` requires 2 generic type arguments like `Update<TDocument, TPartialDocument>(...)`.
