Mr Hiển
Mr Hiển

Reputation: 21

How to check index exists in elasticsearch by NEST 6.x

I use C# How to check an index already exists in Elasticseach.net In the document of Elastic.co bản 1.x I see the method "TypeExists" that version 6 doesn't support

Upvotes: 2

Views: 8398

Answers (1)

Russ Cam
Russ Cam

Reputation: 125538

With 6.x client, it's

var client = new ElasticClient();

if (client.IndexExists("index_name").Exists)
{
    // index exists, do something
}

Upvotes: 1

Related Questions