ES相关问题备忘录

Posted viewgroup

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ES相关问题备忘录相关的知识,希望对你有一定的参考价值。

ES备忘录

ES备忘录

学习ES途中,记录相关问题,获取成长积累
ES官方文档

命令相关

  1. CAT API
  2. INDEX API
  3. SEARCH API

设置相关

  1. 最大返回数量问题
    ES 默认返回10000 条数据,超过10000条,要么使用scroll 进行查询,要么设置最大返回值,否则报如下错误

“reason”: “Result window is too large, from + size must be less than or equal to: [10000] but was [10001]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index level setting.”

设置最大数量可以按照如下方法进行调试

/indexName/_settings
“max_result_window”:“1000000000”

  1. 最大聚合问题
    ES针对聚合做了性能优化,默认不允许聚合数据过大,如果聚合体返回数据过大,返回如下错误

“error”:“root_cause”:[“type”:“too_many_buckets_exception”,“reason”:“Trying to create too many buckets. Must be less than or equal to: [10000] but was [10001]. This limit can be set by changing the [search.max_buckets] cluster level setting.”,“max_buckets”:10000],“type”:“search_phase_execution_exception”,“reason”:“all shards failed”,“phase”:“query”,“grouped”:true,“failed_shards”:[“shard”:0,“index”:“recommend”,“node”:“FJazr4BeSqGp5x8hS0UDxw”,“reason”:“type”:“too_many_buckets_exception”,“reason”:“Trying to create too many buckets. Must be less than or equal to: [10000] but was [10001]. This limit can be set by changing the [search.max_buckets] cluster level setting.”,“max_buckets”:10000],“status”:503

此时可以通过错误中的提示,进行对应的参数设置

/_cluster/settings
“persistent”: “search.max_buckets”: 100000000

以上是关于ES相关问题备忘录的主要内容,如果未能解决你的问题,请参考以下文章

markdown ES6备忘单

markdown ES6出口/进口备忘单

markdown ES6备忘单

ES6 WeakMap 的实际用途是啥?

JS备忘

HttpContext.Current.Session.SessionID相关问题及备忘