bool query with mustand shouldon the level 是什么意思?
我看到下面的查詢:
{
"query": {
"bool": {
"must":
[{
"match": {
"content": {
"reporter": "Ricky"
}
}
}],
"should":
[{
"match": {
"header": {
"query": "nature"
}
}
}]
}
}
}
- 根據使用布爾查詢提高搜索相關性
must意味著and,should意味著or - 在上面的查詢中,
mustandshould("and" 和 "or") 處于同一級別。
- 那么這個布爾查詢是什么意思呢?
- 是否
should對最終分數有貢獻(如果must查詢不占任何位置)?
uj5u.com熱心網友回復:
must should 僅與搜索相關性改進有關,而不僅僅是 and or
上面的查詢意味著:找到所有
content欄位包含“ricky”的檔案,并為那些在其header欄位中也具有“nature”的檔案提供一點幫助。mustMUST be met中的查詢,即如果沒有檔案在其欄位中包含“ricky”content,則結果集中不會有任何匹配項。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/444273.html
標籤:弹性搜索
