【问题标题】:nested: ScriptException [dynamic scripting disabled] elasticsearch嵌套:ScriptException [动态脚本禁用] elasticsearch
【发布时间】:2016-12-21 15:14:05
【问题描述】:

如何通过 symfony config 启用动态脚本?

我只是将 2*2 相乘,但它不起作用。

curl -XGET 'http://localhost:9200/app/user/_search' -d '{
    "script_fields" : {
        "test1" : {
            "script" : "2 * 2"
        }
    }
}'

文件:config.yml

fos_elastica:
    客户:
        默认值:{ 主机:本地主机,端口:9200 }
    索引:
        应用程序:
            类型:
                用户:
                    映射:
                        名称:~
                        销:{类型:geo_point}
                    坚持:
                        # 驱动可以是orm、mongodb、phpcr或propel
                        # listener 和 finder 不支持
                        # 推进并且应该被移除
                        司机:orm
                        型号:AppBundle\Entity\User
                        提供者:~
                        听众:~
                        发现者:~

【问题讨论】:

    标签: elasticsearch symfony


    【解决方案1】:

    您应该在配置中添加以下内容:

    script.inline: true
    script.indexed: true
    

    欲了解更多信息:https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html#enable-dynamic-scripting

    【讨论】:

    • 我已经在 elasticsearch.yml 中添加了这个,但直到没有工作。
    • 你的 elasticserch 版本是多少?
    • 弹性搜索 3.2.0
    • 你的意思是2.3.0? ES重启了吗?
    • 我使用“friendsofsymfony/elastica-bundle”:“3.2.0”
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多