【问题标题】:Running scripts in elasticsearch without enabling dynamic scripting在 elasticsearch 中运行脚本而不启用动态脚本
【发布时间】:2015-11-27 14:42:42
【问题描述】:

事实证明,启用动态脚本对我们的服务器来说代价高昂。如何在不启用动态脚本的情况下运行脚本?

【问题讨论】:

  • 这也取决于这些脚本的性能。你是说那些脚本已经 100% 调整过,但仍然会拖慢你的服务器?

标签: elasticsearch


【解决方案1】:

您可以将脚本写入磁盘,然后像这样使用file 参数访问它

"script": {
    "file": "your_custom_script",
    "lang": "groovy",
    "params": {
        "your_param_value": 3
    }
}

将文件 your_custom_script.groovy 存储在您的 ES config/scripts 文件夹中。

请参阅this blog 了解更多信息。虽然我不确定您将获得多少性能优势。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-17
    • 2016-07-16
    • 1970-01-01
    相关资源
    最近更新 更多