【发布时间】:2021-01-15 10:20:59
【问题描述】:
我想知道我的搜索实例中是否已经存在索引。
以前在库的 v10 中,我可以这样做:
if (serviceClient.Indexes.Exists(indexName)) {...}
在 v11 中,SearchServiceClient 已替换为 SearchIndexClient,后者没有 .Indexes 集合。
我尝试了下面的代码,但它被 Fields cannot be null. To clear values, call Clear. (Parameter 'value') 炸毁了:
string match = indexClient.GetIndexNames().SingleOrDefault(i => i == indexName);
那么查看索引是否存在的新方法是什么?
【问题讨论】:
标签: .net .net-core azure-cognitive-search