Elastic.Clients.Elasticsearch Support for Update without index name

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

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:

return _client.UpdateAsync<T>(indexName, id, configureRequest, cancellationToken);
1 Like

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

I'll check on Monday :slightly_smiling_face:

1 Like

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

@DdeM

Fixed in Generate inference constructor overloads by flobernd · Pull Request #8153 · elastic/elasticsearch-net · GitHub

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

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

1 Like