【发布时间】:2019-01-24 14:22:10
【问题描述】:
使用BulkAll() 批量插入我收到这个奇怪的错误
BulkAll halted after receiving failures that can not be retried from _bulk
但是,当我检查异常时,我仍然得到了成功的响应:
Successful low level call on POST: /cf-lblogs-2019.01.23/cloudflareloadbalancinglogelasticentity/_bulk?
我在这里做错了什么?下面是sn-p的代码:
var waitHandle = new CountdownEvent(1);
var bulk = _client.BulkAll(group.ToList(), a => a
.Index(_index.Replace("*", string.Empty) + group.Key)
.BackOffRetries(2)
.BackOffTime("30s")
.RefreshOnCompleted(true)
.MaxDegreeOfParallelism(4)
.Size(group.Count()));
bulk.Subscribe(new BulkAllObserver(
onNext: response => _logger.LogInformation($"Indexed {response.Page * group.Count()} with {response.Retries} retries"),
onError: HandleInsertError,
onCompleted: () => waitHandle.Signal()
));
waitHandle.Wait();
private void HandleInsertError(Exception e)
{
var exceptionString = e.ToString();
_logger.LogError(exceptionString);
}
巢 6.4.2.
弹性 6.5.4.
【问题讨论】:
标签: c# elasticsearch nest