跟踪reindex任务

时间:2018-03-26 12:59:20

标签: elasticsearch nest elasticsearch-net

所以我开始在ElasticSearch服务器上重新编制索引:

// Start reindexing on the server
var response = client.ReindexOnServer(new ReindexOnServerRequest()
{
  Source = new ReindexSource() { Index = metadataModel.SourceIndexName },
  Destination = new ReindexDestination() {  Index = metadataModel.DestinationIndexName, OpType = Elasticsearch.Net.OpType.Create },
  WaitForCompletion = false,
  Refresh = true
});

var elasticSearchReIndexTaskId = response.Task.ToString();

我找回了任务ID。如何使用Task API跟踪该任务的进度?

如果任务完成,那会出错或返回一些内容吗?

var response = client.TasksList(new TasksListRequest(elasticSearchTaskId));

0 个答案:

没有答案