ES bool查詢


一、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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM