gpt4 book ai didi

elasticsearch - ElasticSearch:min_doc_count如何影响性能?

转载 作者:行者123 更新时间:2023-12-02 22:50:42 24 4
gpt4 key购买 nike

为什么要花时间:

"aggs": {
"Condition": {
"terms": {
"field": "color",
"size": 10,
"min_doc_count": 1
}
}

比这快得多:
    "aggs": {
"Condition": {
"terms": {
"field": "color",
"size": 10,
"min_doc_count": 0
}
}

即使他们都向我返回了相同的汇总结果?

最佳答案

documentation中提取:

Setting min_doc_count=0 will also return buckets for terms that didn’t match any hit. However, some of the returned terms which have a document count of zero might only belong to deleted documents or documents from other types, so there is no warranty that a match_all query would find a positive document count for those terms.



因此,如果删除的文档很多,则性能可能会变差,因为聚合将处理大量的文档。尝试 optimize the index看看性能是否变得相似。

关于elasticsearch - ElasticSearch:min_doc_count如何影响性能?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32135411/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com