java - ElasticSearch 错误 ""Message":"请求大小超过 10485760 字节"
问题描述
使用此方法在 ElasticSearch 中上传 50 mb 大小的巨大 JSON 字符串时 -
public static void postData(String json, String index, String type) {
RestClient client = RestClient.builder(new HttpHost(testHostPreProd, 443, "https")).build();
HttpEntity entity = new NStringEntity(json, ContentType.APPLICATION_JSON);
Response response = client.performRequest("POST", "/" + index + "/" + type + "/_bulk",
Collections.<String, String>emptyMap(), entity);
client.close();
}
错误是
Exception in thread "main" org.elasticsearch.client.ResponseException: POST https:someURL/indexHere/typeHere/_bulk: HTTP/1.1 413 Request Entity Too Large
{"Message":"Request size exceeded 10485760 bytes"}
在有效发送 10k 批次的代码中放置一个计数器可能有效,但我不知道该怎么做。
有关如何处理此问题的任何建议?
解决方案
推荐阅读
- java - 查找丢失的 Spark 分区
- web-scraping - 使用美汤时无法获取特定标签
- googletest - 如何使用全局静态初始化方法正确运行 googletest
- sql - 我们是否应该将代理键与自然键(唯一索引均值)结合起来以提高可读性和便于查询选择?
- mysql - 找不到用于安装wordpress的mysql?
- json - 我无法配置 purgeCSS 来查看 Tailwindcss 选择器的 JSON 文件
- c# - Acumatica - BQL 选择等于字符串的表字段
- php - 如何停止在php中遇到警告的非数字值
- algorithm - 简化表达式树
- r - Actionbutton在R闪亮中第一次不起作用