【发布时间】:2018-02-14 10:20:40
【问题描述】:
我目前遇到的问题是,6 个聚合中有 3 个因错误而失败。
"type": "illegal_argument_exception",
"reason": "Fielddata is disabled on text fields by default. Set fielddata=true on [experience_slug] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory."
有问题的字段被定义为类型关键字(doc_values true),因此查询应该没有问题。 (直接取自 _mapping 部分):
"experience_slug": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"analyzer": "default",
"search_analyzer": "default_search"
},
由于文档、谷歌和 StackOverflow 都没有为这个问题提供答案,我认为存在根本性错误。
我能想象的唯一一件事就是现场未设置的数据。现在,该字段可以确保有内容。
同样在这个过程中,我删除了查询的所有其他部分以隔离问题,使用aggs以及aggregations,重命名聚合的名称只是为了确定..
这是请求正文和匿名搜索 url:
http://localhost:9200/project_development/some_type/_search
{
"aggregations": {
"foo": {
"terms": {
"field": "experience_slug"
}
}
}
}
官方 docker 容器中的 Elasticsearch 5.2.2,内存有限(但足够)。 日志中也没有条目。
如果有任何关于如何解决这个困境的提示,我将不胜感激。
最好的问候
【问题讨论】:
标签: elasticsearch-5