【问题标题】:Elasticsearch.NET version 7 - How to Check If Index ExistsElasticsearch.NET 版本 7 - 如何检查索引是否存在
【发布时间】:2019-07-01 21:07:35
【问题描述】:

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

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

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

【问题讨论】:

    标签: nest elasticsearch.net


    【解决方案1】:

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

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

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

    • 猫
    • 集群
    • 图表
    • Sql
    • 节点
    • 等等……

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-01-09
      • 2021-07-22
      • 2013-03-21
      • 2016-03-21
      • 1970-01-01
      • 1970-01-01
      • 2012-11-30
      • 2015-09-16
      相关资源
      最近更新 更多