动态脚本编译过多,最大值:[75/5m]

anj*_*rik 7 elasticsearch-6

我在 elasticsearch 中遇到以下错误。

{"error":{"root_cause":[{"type":"circuit_breaking_exception","reason":"[script] Too many dynamic script compilations within, max: [75/5m]; please use indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_rate] setting","bytes_wanted":0,"bytes_limit":0}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"en_product_idx2","node":"eFSrhLqNTYubukyF3pz8aw","reason":{"type":"query_shard_exception","reason":"script_score: the script could not be loaded","index_uuid":"IFYbHBBjRxW188SKVh0c4Q","index":"en_product_idx2","caused_by":{"type":"general_script_exception","reason":"Failed to compile inline script [if (params['_source']['sku'] == \"black\") return 999; else return 434-params.ids.indexOf(doc['id'].value.intValue());] using lang [painless]","caused_by":{"type":"circuit_breaking_exception","reason":"[script] Too many dynamic script compilations within, max: [75/5m]; please use indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_rate] setting","bytes_wanted":0,"bytes_limit":0}}}}],"caused_by":{"type":"circuit_breaking_exception","reason":"[script] Too many dynamic script compilations within, max: [75/5m]; please use indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_rate] setting","bytes_wanted":0,"bytes_limit":0}},"status":400}

hon*_*hah 1

编写脚本并不是正常行为,因为脚本需要编译,一段时间内内联脚本编译的次数是有限制的。

脚本编译断路器

您可以按照脚本文档的“首选参数”部分获取更多信息。