gpt4 book ai didi

arrays - 如何在Elasticsearch中按值数组查询/过滤精确计数?

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

我有这些文件:

{"title": "aa","cast": ["a","b","c","a"]}
{"title": "bb","cast": ["a","b","c","b"]}
{"title": "cc","cast": ["a","b","c","c"]}

我使用刻面得到结果。
facets": {
"cast_result": {
"_type": "terms",
"missing": 0,
"total": 9,
"other": 0,
"terms": [
{
"term": "c",
"count": 3
},
{
"term": "b",
"count": 3
},
{
"term": "a",
"count": 3
}
]
}
}
}

但是我希望结果“a”的数量为四,因为在实际文档中“a”的频率为四。“b”和“c”也与“a”相似。

最佳答案

但是我发现一个问题,当分片的数量大于2时,答案是错误的,因此它必须小于2。与副本数无关。

关于arrays - 如何在Elasticsearch中按值数组查询/过滤精确计数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28848809/

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