json - 为什么在Elasticsearch中执行此查询时出现错误

标签 json elasticsearch

我在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中添加enable dynamic scripting,然后重新启动您的节点。将此添加到您的配置文件:

script.inline: true

关于json - 为什么在Elasticsearch中执行此查询时出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37345608/

相关文章:

javascript - 使用 getJSON 从服务器调用带有变音符号的 JSON 文本文件

java - 在 JSON 中嵌套太深...我应该切换到 XML 吗?

java - Jersey 演示应用程序中的 MediaType.APPLICATION_XML 和 MediaType.APPLICATION_JSON

elasticsearch - 查询特定Elastic Search节点

elasticsearch - 如何使用聚合获取文章中单词的重复次数?

elasticsearch - 无法在MultiMatch查询中将模糊性设置为自动

django - 如何让多个范围查询在Elasticsearch中工作?

php - 将带有回车键的 json 发送到 php web 服务

java - 无法从 JSON 字符串实例化类型的值;没有单字符串构造函数/工厂方法

solr - Elasticsearch:可能在分面时排除过滤器? (就像在 Solr 中一样)