我需要在弹性搜索中搜索
select * from tablename where file.content='xyz' and filePermission.Id='abc'
我需要添加什么查询。是否可以为搜索查询提供过滤器?我已将file.content设置为默认字段。
答案 0 :(得分:1)
AND SQL查询可以写成“必须bool查询”:
{
"query" : {
"bool" : {
"must" : [
{ "match" : { "file.content":"xyz"} },
{ "match" : { "filePermission.Id" : "abc"} }
]
}
}
}