BulkAll halted after receiving failures that can not be retried from _bulk 的解决办法-程序旅途

该图片由EnriquePixabay上发布

问题

迁移寻古诗词网时,ElasticSearch 由 7.8 升级到 8.7 了。使用 BulkAll 索引数据时,会报错误:BulkAll halted after receiving failures that can not be retried from _bulk

解决办法

目前最新的的Nest版本是7.17.5,通过调用 .EnableApiVersioningHeader() 启用兼容模式即可解决

IConnectionPool pool = new SingleNodeConnectionPool(new Uri("http://localhost:9200"));

var settings = new ConnectionSettings(pool)
    .EnableApiVersioningHeader();

参考:ElasticSearch - Invalid NEST response built from a successful (200) low level call on POST (bartwullems.blogspot.com)