为什么在弹性搜索中执行此查询时出错 [英] Why I am getting error while executing this query in Elasticsearch

查看:95
本文介绍了为什么在弹性搜索中执行此查询时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ElasticSearch中的查询:

My query in ElasticSearch :

'filter':{              
  'script':{                
      'script':'_source.brand == \"samsung galaxy\"'        
   }        
 }

我收到的错误:

     {
          "shard": 0,
          "index": "test_database",
          "node": "yHIFcx8LQzCJHFYydcpdgA",
          "reason": {
            "type": "script_exception",
            "reason": "scripts of type [inline], operation [search] and lang [groovy] are disabled"
          }
        }
      ]
    },
    "status": 500
  }


推荐答案

您需要启用动态脚本 elasticsearch.yml 然后重新启动你的节点将其添加到您的配置文件中:

You need to enable dynamic scripting in elasticsearch.yml and then restart your node. Add this to your configuration file:

script.inline: true

这篇关于为什么在弹性搜索中执行此查询时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆