我有一个ElasticSearch查询,该查询将结果聚合在一个称为_aggregate
的特定字段上。现在,对于此查询,我遇到了这种奇怪的情况:
"size": 100,
"aggregations": {
"results": {
"terms": {
"field": "_aggregate",
"size": 1000,
"order": {
"_count": "desc"
}
},
"aggregations": {
"bundled": {
"top_hits": {
"sort": [
{
"_weight": "asc"
}
]
}
}
}
}
},
"query": {
"bool": {
"must": [
{
"term": {
"_aggregate": "5713618784853"
}
}
]
}
}
}
当我执行此搜索时,它返回8个匹配项(与预期的一样)。但是,当我查看汇总结果时,发现doc_count为8(到目前为止非常好),但它只会返回3个匹配。
增大_aggregate
字段的大小没有任何效果。
有人知道这是怎么可能的,或者是什么原因造成的?
答案 0 :(得分:1)
这是因为c763e52a, 7a0b435c, efc9ae2e
指标聚合默认会返回3个匹配。您可以覆盖此
function getColor(key, callback) {
if (key !== null) {
chrome.storage.local.get(key,function (obj){
callback(obj)
});
}
}
getColor('color', function(color){
console.log(color)
})