1 {
 2   "aggs": {},
 3   "from": 0,
 4   "query": {
 5     "bool": {
 6       "must": [],
 7       "must_not": [],
 8       "should": [
 9         {
10           "bool": {
11             "must": [
12               {
13                 "term": {
14                   "name": "ming"
15                 }
16               },
17               {
18                 "term": {
19                   "age": "30"
20                 }
21               }
22             ]
23           }
24         },
25         {
26           "bool": {
27             "must": [
28               {
29                 "term": {
30                   "name": "qiang"
31                 }
32               },
33               {
34                 "term": {
35                   "age": "18"
36                 }
37               }
38             ]
39           }
40         }
41       ]
42     }
43   },
44   "size": 10000,
45   "sort": [],
46   "track_total_hits": true
47 }

就是 (qiang + 18) or (ming + 30)

 为什么有时候需要显示声明

minimum_should_match:1
query[bool][minimum_should_match]:1
 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-02
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-27
  • 2022-12-23
  • 2021-07-11
  • 2021-11-02
相关资源
相似解决方案