在我的一個elasticsearch查詢中,我正在執行一個查詢 聚合,我發現桶的doc_count總數是>比點擊總數多。 (在這個例子中,它的2085697總命中率與3071915桶的總doc_counts。) 這正常嗎?以前我認為總命中率將總是=總桶的doc_counts,或者如果在聚合中精確的欄位名在一些條目中沒有找到,則會更大。
uj5u.com熱心網友回復:
如果你要聚合的欄位包含了一個陣列的值,這絕對是可能的。
例如,假設你有以下檔案:
{
"result_type": [1, 2]
}
如果你在result_type欄位上聚合,你會得到以下回應,即hits.total.value = 1(即一個檔案),但有兩個桶,doc_count = 1。
{
"taken" : 2,
"timed_out" : false,
"_shards" : {
"總數" : 1,
"成功" : 1,
"跳過" : 0,
"失敗" : 0
},
"點擊率" : {
"總數" : {
"值" : 1,
"關系" : "eq"
},
"max_score" : null,
"點擊率" : [ ]
},
"聚合" : {
"resultType" : {
"doc_count_error_upper_bound" : 0,
"sum_other_doc_count" : 0,
"buckets" : [
{
"key" : 1,
"doc_count" : 1
},
{
"key" : 2,
"doc_count" : 1
}
]
}
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/315184.html
標籤:

