Q:有两个人掉到陷阱里了,死的人叫死人,活人叫什么?

elasticsearch totalhits过高影响性能问题

Elasticsearch | 作者 finchan | 发布于2020年03月08日 | 阅读数:2402

3台机器,每台128G内存,3个节点,每个节点32G堆内存
索引文档8千万左右,大小70GB
以下是mapping
{ - 
"business_ads-20200307": { -
"mappings": { -
"default": { -
"properties": { -
"item_brand": { -
"type": "keyword",
"store": true
},
"item_id": { -
"type": "keyword",
"store": true
},
"item_url": { -
"type": "text",
"store": true
},
"simhash": { -
"type": "keyword",
"store": true
},
"tags": { -
"type": "text",
"store": true,
"analyzer": "whitespace_analyzer"
},
"title": { -
"type": "text",
"store": true,
"analyzer": "whitespace_analyzer"
}
}
}
}
}
}
如下是查询条件:
{
"size": 100,
"query": {
"term": {
"tags": {
"value": "男"

}
}
}
}
返回结果:
 "took": 764,
"timed_out": false,
"_shards": {
"total": 3,
"successful": 3,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 296774,
"max_score": 1.0,
"hits": [
{
hits数目太多,影响查询性能
已邀请:

byx313 - BLOG:https://www.jianshu.com/u/43fd06f9589c

赞同来自:

m 看看大神解决方案

要回复问题请先登录注册