Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ES更新数据报错: Too many dynamic script compilations within, max: [75/5m]; please use indexed, or scripts with parameters instead; #28

Open
jamesBan opened this issue Nov 9, 2020 · 0 comments
Labels
search 搜索引擎

Comments

@jamesBan
Copy link
Owner

jamesBan commented Nov 9, 2020

转自:http://leojen.cn/index.php/archives/225/
在更新数据的时候报错:

Too many dynamic script compilations within, max: [75/5m]; please use indexed, or scripts with parameters instead;
更新脚本是这样的:

"script" : {
        "source": "ctx._source.age=20",
        "lang": "painless"
    }

1.可以通过:

PUT _cluster/settings
{
    "transient" : {
        "script.max_compilations_rate" : "100/1m"
    }
}

也就是提高阀值,系统默认是100/1m 也就是一分钟编译100。
但是这种方法显然治标不治本,从报错里已经给出答案了,采用params脚本,也就是把要更新的值放到params里:

"script" : {
        "source": "ctx._source.age=params.age",
        "lang": "painless",
        "params" : {
            "age": 20
        }
    }

注意2种脚本的写法。这样才能从根本上解决。

@jamesBan jamesBan added the search 搜索引擎 label Nov 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
search 搜索引擎
Projects
None yet
Development

No branches or pull requests

1 participant