ES聚合报错
在测试Elasticsearch聚合的时候报了一个错误。具体如下:
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. Alternatively use a keyword field instead."
}
],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,
"failed_shards": [
{
"shard": 0,
"index": "megacorp",
"node": "wlvuJ0f_SsCxys6ZW5j7eA",
"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. Alternatively use a keyword field instead."
}
}
]
},
"status": 400
}
此时需要使用.keyword即可满足,如下
GET /megacorp/employee/_search
{
"aggs": {
"all_interests": {
"terms": { "field": "interests.keyword" }
}
}
}
结果如下
{
"took": ,
"timed_out": false,
"_shards": {
"total": ,
"successful": ,
"skipped": ,
"failed":
},
"hits": {
"total": ,
"max_score": ,
"hits": [
{
"_index": "megacorp",
"_type": "employee",
"_id": "",
"_score": ,
"_source": {
"first_name": "Jane",
"last_name": "Smith",
"age": ,
"about": "I like to collect rock albums",
"interests": [
"music"
]
}
},
{
"_index": "megacorp",
"_type": "employee",
"_id": "",
"_score": ,
"_source": {
"first_name": "John",
"last_name": "Smith",
"age": ,
"about": "I love to go rock climbing",
"interests": [
"sports",
"music"
]
}
},
{
"_index": "megacorp",
"_type": "employee",
"_id": "",
"_score": ,
"_source": {
"first_name": "Douglas",
"last_name": "Fir",
"age": ,
"about": "I like to build cabinets",
"interests": [
"forestry"
]
}
}
]
},
"aggregations": {
"all_interests": {
"doc_count_error_upper_bound": ,
"sum_other_doc_count": ,
"buckets": [
{
"key": "music",
"doc_count":
},
{
"key": "forestry",
"doc_count":
},
{
"key": "sports",
"doc_count":
}
]
}
}
}
ES聚合报错的更多相关文章
- Springboot集成ES启动报错
报错内容 None of the configured nodes are available elasticsearch.yml配置 cluster.name: fans node.name: no ...
- Elasticsearch 6.2.3版本 执行聚合报错 Fielddata is disabled on text fields by default
背景说明 执行<Elasticsearch 权威指南>的示例,在执行聚合查询的时候,报错 Fielddata is disabled on text fields by default. ...
- MongoDb 聚合报错
聚合框架它是数据聚合的一个新框架,其概念类似于数据处理的管道. 每个文档通过一个由多个节点组成的管道,每个节点有自己特殊的功能(分组.过滤等),文档经过管道处理后,最后输出相应的结果. 管道基本的功能 ...
- ES部署报错 max file size 和 kibana 报错File size limit exceeded
启动失败一 ERROR: [2] bootstrap checks failed [1]: max file descriptors [4096] for elasticsearch process ...
- ES启动报错之引导检测失败
[--16T18::,][ERROR][o.e.b.Bootstrap ] [node-] node validation exception [] bootstrap checks failed [ ...
- ES启动报错最大进程数太少
[--16T18::,][INFO ][o.e.b.BootstrapChecks ] [node-] bound or publishing to a non-loopback address, e ...
- es 启动报错 内存太小
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144] elastics ...
- 【Elasticsearch】ES中时间查询报错:Caused by: ElasticsearchParseException[failed to parse date field [Sun Dec 31 16:00:00 UTC 2017] with format [yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis]];
ES中时间查询报错:Caused by: ElasticsearchParseException[failed to parse date field [Sun Dec 31 16:00:00 UTC ...
- python:rs, ws, es = select.select(inputs, [], []) --报错error 10022
昨晚折腾的1个多钟,直到3点多才睡,感觉自己也是热爱代码了,敲3个多钟一点也不累(其实是为了凌晨6点起来抢票回家了^_^) 练习python中select进行异步通信-防止socket.recv方法阻 ...
随机推荐
- [置顶]
sscanf() - 从一个字符串中读进与指定格式相符的数据
在做一道九度上机题时,突然发现sscanf()函数非常有用,就顺便从网上搜集资料整理一下. sscanf() 的作用:从一个字符串中读进与指定格式相符的数据. 原型: int sscanf (cons ...
- 爬取github上流行的python项目
# -*- coding:utf-8 -*- __author__ = "MuT6 Sch01aR" import requests from pyquery import PyQ ...
- python's sixteenth day for me 员工信息表
import os user_dic = { 'username':None, 'password':None, 'login':True } flag = False name_list = ['i ...
- KMP算法详解(转)
转自http://www.matrix67.com/blog/archives/115 通常我们的方法是枚举从A串的什么位置起开始与B匹配,然后验证是否匹配.假如A串长度为n,B串长度为m,那么这种方 ...
- coprime Sequence
Do you know what is called ``Coprime Sequence''? That is a sequence consists of nn positive integers ...
- 【294】◀▶ Python 字符串说明
目录: 一.Python访问字符串中的值 二. Python 转义字符 三.Python 字符串运算符 参考:Python 字符串 一.Python访问字符串中的值 Python不支持单字符类型, ...
- oscache.properties文件配置
1.cache.memory是否使用内存缓存:值为:true或false.默认为true:如设置为false,那cache只能缓存到数据库或硬盘中. 2.cache.capacity缓存的最大数量.默 ...
- 在cmd中 操作 数据库 MySQL 的一些命令
环境变量配置配置好以后, 打开cmd 连接:mysql -h主机地址 -u用户名 -p用户密码 (注:u与root可以不用加空格,其它也一样) 断开:exit (回车) 创建授权:grant sele ...
- 使用Nuget发布自己的类库包
NuGet是一个为大家所熟知的Visual Studio扩展,通过这个扩展,开发人员可以非常方便地在Visual Studio中安装或更新项目中所需要的第三方组件,同时也可以通过NuGet来安装一些V ...
- jmeter beanshell
//获取返回数据 String json = prev.getResponseDataAsString(); ///加入变量vars.put("restr",json); //获取 ...