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