admin管理员组文章数量:1594639
在elasticsearch中对数据进行聚合,想得出每个来源的数据量,mapping:
"news_source": {
"type": "text"
},
"related_freq": {
"type": "integer"
},
查询条件:
GET /event_news/_search
{
"size": 0,
"aggs": {
"news_source_info":{
"terms": {
"field": "news_source"
},
"aggs": {
"total_sum": {
"sum": {"field": "related_freq"}
}
}
}
}
}
结果报错
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "Fielddata is disabled on text fields by default. Set fielddata=true on [news_abstract] 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": "event_news",
本文标签: 类型ElasticsearchText
版权声明:本文标题:elasticsearch对text类型进行聚合时遇到的问题 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/dongtai/1725721776a1038462.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论