Elasticsearch:from&size返回值最大记录的修改设置

PHP 投稿 10300 0 评论

Elasticsearch:from&size返回值最大记录的修改设置

这篇关于Elasticsearch:from&size返回值最大记录的修改设置的文章,觉得挺不错的,感兴趣的php开发者可以参考下,希望对大家在学习php的成长路上有所帮助!

我记得自己当年初次使用elasticsearch时用from&size的方法进行分页查询,由于我查询时设置的返回记录值太大,导致(’Result window is too large, from + size must be less than or equal to:[10000] but was [10100]. See the scroll api for a more efficient way to requestlarge data sets. This limit can be set by changing the[index.max_result_window] index level parameter.’)

出错后,我上网查询了不少解决办法,大佬们都说要设置index.max_result_window,但是我按他们说的设置后,异常并没有解决.最终,在大神的指点下,我学到了另一种方法: 


curl -XPUT elasticsearch:9200/索引名/type名/_settings -d '{ "index" : { "max_result_window" : 1000000}}'

实际解决的时候发现通过以上请求没有解决问题,最后是通过下面的请求解决了该问题:


curl -XPUT elasticsearch:9200/索引名/_settings?preserve_existing=true -d '{"max_result_window":"1000000"}'

总结

以上就是关于Elasticsearch:from&size返回值最大记录的修改设置全部内容,希望这篇文章能够帮你解决如相关的PHP问题,更多请关注PHP栏目的其它相关文章!

编程笔记 » Elasticsearch:from&size返回值最大记录的修改设置

赞同 (52) or 分享 (0)
游客 发表我的评论   换个身份
取消评论

表情
(0)个小伙伴在吐槽