C# NEST Client Elasticsearch 7.x DeleteIndex

According to the NEST breaking change list in version 7.0.0, the DeleteIndex method is no longer available. Does anyone know if the same behavior (deleting an index or clearing all documents in an index) is able to be performed from the NEST client another way?

Take a look at the Namespaced API methods and Upgrade Assistant section of the breaking changes.

Essentially, the API surface of Elasticsearch has continued to grow, with over 270 APIs now, and likely more in the future. The client originally exposed all API methods on the root of the client, which was an OK decision when it was first conceived 9 years ago(!) but over time, has become increasingly more onerous on the user to navigate and explore through an IDE.

We took the decision (not lightly) to namespace the API methods in the client under properties on the root of the client, named by the grouping that they appear in the REST API spec. This should make navigating API methods easier going forward and brings the .NET client in line with the other official clients.

We understand that this is a big change to users however, so created the Nest.7xUpgradeAssistant nuget package to help with the transition. This packages adds back in all the API methods on the root client that exist in 6.x, with these API methods delegating to the new location of the API on the 7.x client. A compiler warning is emitted indicating what action should be taken to bring usage in line with the namespaced API methods so that eventually, the NEST.7xUpgradeAssistant package can be removed.

For DeleteIndex specifically, this method lives under the Indices namespace

var deleteResponse = client.Indices.Delete("index-name");
1 Like

Ah, apologies for not reading through the breaking changes list thoroughly.

Thank you much, I appreciate the guidance!

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