[英]How can I query an exact value (with space) in elasticsearch array list
[英]How can I query/filter an exact count by an array of values in Elasticsearch?
我有這些文件:
{"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。與副本數無關。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.