Elasticsearch在進行聚合操作時提示Fielddata is disabled on text fields by default
執行下列語句是報錯
GET /megacorp/employee/_search { "aggs": { "all_interests": { "terms": { "field": "interests" } } } }
報錯
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "Fielddata is disabled on text fields by default. Set fielddata=true on [interests] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory."
}
],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,
"failed_shards": [
{
"shard": 0,
"index": "megacorp",
"node": "-Md3f007Q3G6HtdnkXoRiA",
"reason": {
"type": "illegal_argument_exception",
"reason": "Fielddata is disabled on text fields by default. Set fielddata=true on [interests] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory."
}
}
],
"caused_by": {
"type": "illegal_argument_exception",
"reason": "Fielddata is disabled on text fields by default. Set fielddata=true on [interests] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory."
}
},
"status": 400
}
搜了一下應該是5.x後對排序,聚合這些操作用單獨的(fielddata)快取到記憶體裡了,需要單獨開啟,官方解釋在此fielddata
簡單來說就是在聚合前執行如下操作
PUT megacorp/_mapping/employee/
{
"properties": {
"interests": {
"type": "text",
"fielddata": true
}
}
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28282660/viewspace-2142361/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 使用elasticsearch,Elasticsearch Scripts disabledElasticsearch
- 在elasticsearch中簡單的使用script_fieldsElasticsearch
- elasticsearch中使用runtime fieldsElasticsearch
- Elasticsearch聚合學習之一:基本操作Elasticsearch
- Elasticsearch 聚合Elasticsearch
- 在 Django 中使用 Celery 來進行耗時操作Django
- 使用ELASTICSEARCH進行近實時索引 - bozhoElasticsearch索引
- ElasticSearch 聚合分析Elasticsearch
- ElasticSearch聚合分析Elasticsearch
- [Cexpert-002] How to assign default values to fields/members of a struct?Struct
- ES 24 - 如何通過Elasticsearch進行聚合檢索 (分組統計)Elasticsearch
- Nessus提示API Disabled錯誤API
- elasticsearch 聚合之 date_histogram 聚合ElasticsearchHistogram
- elasticsearch之metric聚合Elasticsearch
- 呼叫webservice時提示對操作的回覆訊息正文進行反序列化時出錯Web
- 重疊IO操作在進行中
- Elasticsearch聚合學習之二:區間聚合Elasticsearch
- Laravel 54 配置 Elasticsearch 時的報錯提示LaravelElasticsearch
- ElasticSearch中使用ik分詞器進行實現分詞操作Elasticsearch分詞
- 使用go在mongodb中進行CRUD操作MongoDB
- Elasticsearch系列---聚合查詢(一)Elasticsearch
- Elasticsearch系列---聚合查詢原理Elasticsearch
- elasticsearch bucket 之rare terms聚合Elasticsearch
- Elasticsearch 系列(五)- 資料聚合Elasticsearch
- elasticsearch 之 histogram 直方圖聚合ElasticsearchHistogram直方圖
- 將聚合新增到 Elasticsearch 查詢Elasticsearch
- SAP AET fields的自定義行為
- 【Mongo】mongo聚合操作Go
- 在shell提示下操作檔案(轉)
- Elasticsearch聚合的巢狀桶如何排序Elasticsearch巢狀排序
- ElasticSearch 簡單的 搜尋 聚合 分析Elasticsearch
- Go 呼叫 elasticsearch 批量操作介面 “/_bulk” ,提示"\n"錯誤GoElasticsearch
- 使用 iotop 監控哪些程式在進行I/O操作
- golang操作ElasticsearchGolangElasticsearch
- ElasticSearch基本操作Elasticsearch
- ElasticSearch - 基本操作Elasticsearch
- 使用ConnectableFlux在elasticsearch上進行後臺批處理 - Jeroen van WilgenburgUXElasticsearch
- [進行中] Elasticsearch 終極教程——目錄Elasticsearch