使用elasticsearch,Elasticsearch Scripts disabled
關鍵詞搜尋的時候,報錯
Elasticsearch::Transport::Transport::Errors::BadRequest at /micro/complex_search/complex
[400] {"error":{"root_cause":[{"type":"script_exception","reason":"scripts of type [inline], operation [search] and lang [groovy] are disabled"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"development_hospitals_1482752510430","node":"fnwviKt7Q1etguNZ_MqwHg","reason":{"type":"query_parsing_exception","reason":"script_score the script could not be loaded","index":"development_hospitals_1482752510430","line":1,"col":157,"caused_by":{"type":"script_exception","reason":"scripts of type [inline], operation [search] and lang [groovy] are disabled"}}}]},"status":400}
解決辦法:
Es 2.2版本中,在查詢語句中使用script 時,提示如下錯誤
scripts of type [inline], operation [aggs] and lang [groovy] are disabled
因為新版本的elasticsearch中,基於安全考慮,預設禁用了動態指令碼功能.通過修改配置檔案開啟動態指令碼功能
編輯 config/elasticsearch.yml 檔案,新增
script.inline: on
script.indexed: on
script.file: on
相關文章
- Elasticsearch使用系列-Docker搭建Elasticsearch叢集ElasticsearchDocker
- elasticsearch的使用Elasticsearch
- Elasticsearch使用系列-.NET6對接ElasticsearchElasticsearch
- ElasticSearch Java API使用ElasticsearchJavaAPI
- Laravel 下 Elasticsearch 使用LaravelElasticsearch
- Django中使用ElasticSearchDjangoElasticsearch
- 【Elasticsearch】Elasticsearch 索引模板Elasticsearch索引
- Elasticsearch精進之路:elasticsearch-head外掛使用教程Elasticsearch
- Elasticsearch 技術分析(九):Elasticsearch的使用和原理總結Elasticsearch
- 使用 Java API 操作 elasticsearchJavaAPIElasticsearch
- Elasticsearch 安裝和使用Elasticsearch
- elasticsearch中使用runtime fieldsElasticsearch
- Elasticsearch(windows)使用入門ElasticsearchWindows
- ElasticSearch8 - SpringBoot整合ElasticSearchElasticsearchSpring Boot
- elasticsearch 6.x 與elasticsearch 7.x 配置與使用(Java)ElasticsearchJava
- ElasticsearchElasticsearch
- 使用Spring Boot和Elasticsearch教程Spring BootElasticsearch
- MySQL和Elasticsearch使用場景MySqlElasticsearch
- .Net Core中使用ElasticSearch(二)Elasticsearch
- ElasticSearch基本使用姿勢二Elasticsearch
- ElasticSearch7使用指導Elasticsearch
- elasticsearch 的 update by query 使用案例Elasticsearch
- Elasticsearch - Docker安裝Elasticsearch8.12.2ElasticsearchDocker
- Elasticsearch學習(三)springboot整合ElasticSearchElasticsearchSpring Boot
- 從elasticsearch6.2.4到elasticsearch7.4.0Elasticsearch
- Elasticsearch核心技術(二):Elasticsearch入門Elasticsearch
- ElasticSearch中介軟體系列--elasticsearch-sqlElasticsearchSQL
- ElasticSearch安裝及java Api使用ElasticsearchJavaAPI
- Laravel 使用 Elasticsearch 全域性搜尋LaravelElasticsearch
- 在Laravel專案中使用ElasticsearchLaravelElasticsearch
- Elasticsearch 5.6 原理和使用總結Elasticsearch
- Elasticsearch Head外掛使用小結Elasticsearch
- RabbitMQ和Elasticsearch的使用筆記MQElasticsearch筆記
- SpringBoot 使用 Elasticsearch 問題彙總Spring BootElasticsearch
- Laravel6 使用 ElasticSearch7.10LaravelElasticsearch
- ElasticSearch(八)Elasticsearch-head 連線不上Elasticsearch的原因和解決方案Elasticsearch
- Elasticsearch MappingElasticsearchAPP
- Elasticsearch DocumentElasticsearch
- 【go】【Elasticsearch】GoElasticsearch