3

在 Elasticsearch.NET 6.x 中,可以使用IElasticClient以下方法检查索引是否存在:

    bool exists = elasticClient.IndexExists("my-index-name").Exists;

在 Elasticsearch.NET 版本 7 中删除了方法。

4

1 回答 1

12

在 Elasticsearch.NET 版本 7 中,与索引操作相关的方法已移至IndicesNamespace,因此IndexExists方法已移至:

    bool exists = elasticClient.Indices.Exists("my-index-name").Exists;

同样,不同的方法已移至:

  • 图形
  • Sql
  • 节点
  • ETC...
于 2019-07-01T13:07:35.333 回答