首页 > 编程语言 > 详细

java 传json 设置 ES max_result_window

时间:2020-05-09 17:23:01      阅读:193      评论:0      收藏:0      [点我收藏+]

ES分页查询,想偷懒,数据超过一万多一些可以设置一下max_result_window

 

Map<String,String> params = Collections.singleMap("pretty","true");
String json = "{"
+"\"index\":{"
+"\"max_result_window\":30000"
+"}"
+"}"

HttpEmpty entity = new NStringEntity(json,ContentType.APPLICATION_JSON);

response = restClient.performRequest("PUT","/_index/_settings",params,entity);

 

但还是建议使用scrollId 查询。

java 传json 设置 ES max_result_window

原文:https://www.cnblogs.com/dxk1019/p/12858751.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!