elasticsearch dsl语句问题 where SQRen='xxx' and (nameCn=='yyyy' or nameEn=='yyyy')

xiwang800 2016-11-10 10:34:59
我想要实现的条件是 where SQRen='xxx' and (nameCn=='yyyy' or nameEn=='yyyy')

下面的dsl语句只i能查询出SQRen='北京华为鼎正科技发展有限公司'的数据,但是数据nameCn,nameEn都是不是小米,

{
"query": {
"bool": {
"must": {
"match": {
"SQRen": {
"query": "北京华为鼎正科技发展有限公司",
"type": "phrase_prefix"
}
}
},
"should": [
{
"match": {
"nameCn": {
"query": "小米",
"type": "boolean"
}
}
},
{
"match": {
"nameEn": {
"query": "小米",
"type": "boolean"
}
}
}
]
}
}
}


...全文
385 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiwang800 2016-11-10
  • 打赏
  • 举报
回复
解决了. { "query": { "bool": { "must": [ { "match": { "SQRen": { "query": "北京华为鼎正科技发展有限公司", "type": "phrase_prefix" } } }, { "bool": { "should": [ { "match": { "nameCn": { "query": "华为", "type": "boolean" } } }, { "match": { "nameEn": { "query": "华为", "type": "boolean" } } } ] } } ] } } }

2,760

社区成员

发帖
与我相关
我的任务
社区描述
搜索引擎的服务器通过网络搜索软件或网络登录等方式,将Internet上大量网站的页面信息收集到本地,经过加工处理建立信息数据库和索引数据库。
社区管理员
  • 搜索引擎技术社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧