java 传json 设置 ES max_result_window


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 查询。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM