弹性搜索错误“&引用;“讯息”:&引用;请求大小超过10485760字节”;

弹性搜索错误“&引用;“讯息”:&引用;请求大小超过10485760字节”;,
Warning: implode(): Invalid arguments passed in /data/phpspider/zhask/webroot/tpl/detail.html on line 45
,,使用此方法在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

使用此方法在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();
}
在代码中加入一个计数器,可以发送10k批,但我不知道如何做到这一点


关于如何处理这个问题有什么建议吗?

您的
http.max\u content\u length
设置为什么?这表明默认值为
100mb
,因此您应该能够索引
50mb
文档:如果您在AWS上使用hosted Elastic,则根据实例大小存在网络限制
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"}