elasticsearch 实现 a=1 and b =2 and (c =3 or d =4)
GET rtc_video_record/_search
{
"query": {
"bool": {
"filter": [
{
"term": {
"enterpriseId": 8000559
}
},
{
"term": {
"scene" : "chat"
}
},
{
"bool": {
"should": [
{
"match": {
"sceneId" : "3ea601e4-0007-4ba4-9102-656fb2a3910b.1626157842"
}
},
{
"match": {
"duration": 24
}
}
]
}
}
]
}
}
}
elasticsearch 实现 a in (1,2,3)查询
方式一(推荐):
GET rtc_video_record/_search
{
"query": {
"bool": {
"filter": [
{
"terms":{
"scene":[1,2,3]
}
}
]
}
}
}
方式二:
GET rtc_video_record/_search
{
"query": {
"bool": {
"should": [
{
"match": {
"scene": 1
}
},
{
"match": {
"scene": 2
}
}
]
}
}
}
|