ElasticSearch 7.1删除索引C#API

问题描述 投票:0回答:1

我正在更新我的项目,以使用v6.8中的ES&NEST v7.1,并且我想知道IndicesDeleteAsync API的对应对象。

Task<TResponse> IndicesDeleteAsync<TResponse>(string index, DeleteIndexRequestParameters requestParameters = null, CancellationToken ctx = default(CancellationToken)) where TResponse : class, IElasticsearchResponse, new();

[在7.1中的lowLevelClient中具有删除索引的功能,但是它需要id参数并删除文档。

Task<TResponse> DeleteAsync<TResponse>(string index, string id, DeleteRequestParameters requestParameters = null, CancellationToken ctx = default(CancellationToken)) where TResponse : class, IElasticsearchResponse, new();

我不想删除索引中的文档,我想删除整个索引。

我如何在v7.x中执行此任务?

c# elasticsearch nest
1个回答
0
投票

创建和删除的方法已移至索引名称空间

var response = elasticClient.Indices.DeleteAsync(“ indexname”);

请参阅(elasticsearch-net / releases / tag / 7.0.0)中的“命名空间API方法和升级助手” [https://github.com/elastic/elasticsearch-net/releases/tag/7.0.0],以获取升级帮助。

© www.soinside.com 2019 - 2024. All rights reserved.