Hello,World

es聚合统计时间太长

Elasticsearch | 作者 illbehere | 发布于2018年01月11日 | 阅读数:4161

我要从几十亿的文档中先match查询 再count某个字段,时间耗时太长,匹配较多的统计长达几分钟,快的几秒能出来。请问有什么好的优化方法么
已邀请:

illbehere - 80后it男

赞同来自:

 
curl -XGET "http://ip:9200/index/type/_search?pretty" -d'
{
"query": {
"match": {
"name": "新西兰空运进口冰鲜帝王鲑三文鱼200g可切片新鲜日料刺身生鱼片"
}
},
"aggs": {
"distinct_groupcode" : {
"cardinality" : {
"field" : "groupcode.hash",
"precision_threshold" : 400
}
},
"distinct_phone" : {
"cardinality" : {
"field" : "phone.hash",
"precision_threshold" : 400
}
}
},
"size": 0,
"min_score": 20
}'
这是我的检索代码

要回复问题请先登录注册