使用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在進行聚合操作時提示Fielddata is disabled on text fields by defaultElasticsearch
- ElasticSearch(六) Elasticsearch在Thinkphp5.0中的使用ElasticsearchPHP
- 【Elasticsearch】Elasticsearch 索引模板Elasticsearch索引
- ElasticSearch Java API使用ElasticsearchJavaAPI
- Laravel 下 Elasticsearch 使用LaravelElasticsearch
- Django中使用ElasticSearchDjangoElasticsearch
- Elasticsearch 入門使用Elasticsearch
- elasticsearch api client使用ElasticsearchAPIclient
- Elasticsearch 技術分析(九):Elasticsearch的使用和原理總結Elasticsearch
- Elasticsearch精進之路:elasticsearch-head外掛使用教程Elasticsearch
- Elasticsearch 安裝和使用Elasticsearch
- Elasticsearch(windows)使用入門ElasticsearchWindows
- 使用 Java API 操作 elasticsearchJavaAPIElasticsearch
- Elasticsearch的Bulk API使用ElasticsearchAPI
- ElasticSearch(五) Elasticsearch-jdbc實現MySQL同步到ElasticSearchElasticsearchJDBCMySql
- ElasticsearchElasticsearch
- elasticsearch 6.x 與elasticsearch 7.x 配置與使用(Java)ElasticsearchJava
- ElasticSearch7使用指導Elasticsearch
- elasticsearch 的 update by query 使用案例Elasticsearch
- ElasticSearch基本使用姿勢二Elasticsearch
- .Net Core中使用ElasticSearch(二)Elasticsearch
- elasticsearch中使用runtime fieldsElasticsearch
- MySQL和Elasticsearch使用場景MySqlElasticsearch
- 從elasticsearch6.2.4到elasticsearch7.4.0Elasticsearch
- Elasticsearch核心技術(二):Elasticsearch入門Elasticsearch
- ElasticSearch中介軟體系列--elasticsearch-sqlElasticsearchSQL
- Elasticsearch - Docker安裝Elasticsearch8.12.2ElasticsearchDocker
- ElasticSearch8 - SpringBoot整合ElasticSearchElasticsearchSpring Boot
- Elasticsearch 聚合Elasticsearch
- Elasticsearch laravelElasticsearchLaravel
- Elasticsearch DocumentElasticsearch
- ElasticSearch研究Elasticsearch
- flume + elasticsearchElasticsearch
- ElasticSearch 概述Elasticsearch
- Elasticsearch索引。Elasticsearch索引