elasticsearch bool 的坑
来源:互联网 发布:已知数据求标准误 编辑:程序博客网 时间:2024/06/05 06:22
{
“query”: {
“bool”: {
“must_not”: [
{
“term”: {
“item_type”: 4
}
},
{
“term”: {
“can_see”: true
}
}
],
“should”: [
{
“regexp”: {
“item_no”: “.?2602.?”
}
},
{
“regexp”: {
“description”: “.?2602.?”
}
},
{
“regexp”: {
“series_name”: “.?2602.?”
}
},
{
“regexp”: {
“name”: “.?2602.?”
}
}
]
}
}
}
结果是must_not and should
{
“query”: {
“bool”: {
“must”: [
{
“term”: {
“item_type”: 4
}
},
{
“term”: {
“can_see”: true
}
}
],
“should”: [
{
“regexp”: {
“item_no”: “.?2602.?”
}
},
{
“regexp”: {
“description”: “.?2602.?”
}
},
{
“regexp”: {
“series_name”: “.?2602.?”
}
},
{
“regexp”: {
“name”: “.?2602.?”
}
}
]
}
}
}
结果是must or should
原因是:bool查询也是采用more_matches_is_better的机制,因此满足must和should子句的文档将会合并起来计算分值。
- elasticsearch bool 的坑
- Elasticsearch-bool组合查询
- [Elasticsearch] 全文搜索 (三) - match查询和bool查询的关系,提升查询子句
- [Elasticsearch] 全文搜索 (三) - match查询和bool查询的关系,提升查询子句
- BOOL和bool的区别
- BOOL和bool的区别
- BOOL 和 bool 的区别
- BOOL和bool的区别
- BOOL和bool的区别
- BOOL 与bool 的区别
- BOOL和bool的区别
- BOOL和bool的区别
- BOOL与bool 的区别
- BOOL和bool的区别
- BOOL和bool的区别
- BOOL与bool的区别
- BOOL和bool的区别
- BOOL与bool的区别
- 四层和七层负载均衡的区别
- Caused by: java.lang.NumberFormatException: Expected an int but was 0.15 at line 1 c
- HDOJ 3468 Treasure Hunting (BFS+DFS+匈牙利算法) 综合性好题,好题!!!
- 【超级经典】程序员装B指南(转)
- Mac 快捷键集合
- elasticsearch bool 的坑
- 汇编cmp指令
- Spring中配置和读取多个Properties文件
- Exception encountered during context initialization
- 华为SSN1PETF8和SSN1PEFF8接口板不能达到限速问题说明
- 端口分类调研
- bzoj1556 (DP)
- 开源的rtsp实现
- Class的基本语法