ES Nest IndexMany批量更新触发Request Entity Too Large

代码:

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

你可能感兴趣的:(es,c#,es)