代码:
List<string> uriList=null;
var pool = new StaticConnectionPool(uriList);
var settings = new ConnectionSettings(pool).DefaultIndex(TAGS_INDEX_NAME);
elasticClient = new ElasticClient(settings);
List<T> tagInfos=null;
BulkResponse response = elasticClient.IndexMany(tagInfos, TAGS_INDEX_NAME);
异常:
Invalid NEST response built from a unsuccessful (413) low level
远程服务器返回错误: (413) Request Entity Too Large
原因:
为提高es请求效率,使用分批处理数据,未考虑数据的大小导致
解决方案:
控制文档大小,避免触发 Request Entity Too Large异常
参考文档:https://stackoverflow.com/questions/34787350/index-indexmany-indexasnyc-indexmanyasync-with-nest

本文探讨了在使用Elasticsearch进行大批量数据导入时遇到的413 RequestEntityTooLarge异常,分析了其原因在于未合理控制文档大小,并提出了通过分批处理数据来避免该异常的解决方案。
559

被折叠的 条评论
为什么被折叠?



