一、bool查詢包含四種操作
1.must
2.must not
3.filter
4.should
二、功能
1.must 對應mysql的 and a=
2.must not 對應mysql的 and a!=
3.filter 對應mysql的 and a=
4.should 對應mysql的 or a=
三、must和filter比較
1.must算分,filter不算分
2.filter效率比must高
四、filter效率高的原理
1.query context:文檔更加匹配查詢條件,分數越高越匹配
2.filter context:文檔是否匹配查詢條件,並且ES會緩存查詢結果
參考:
https://blog.csdn.net/pony_maggie/article/details/106062284