must should 的使用
GET /http_index/type/_search
{
  "query": {
    "bool": {
      "should": [
        {
          "bool": {
            "must": [
              {
                 "term" : {
                  "field1" : {
                    "value" : 110,
                    "boost" : 1.0
                  }
                }
              },
                {
                  
                  "terms": {"field2": [
                  100037,
                  100055,
                  100060
                  ]
                }
                }
            ]
          }
        },
        {
          "bool": {
            "must": [
                {"terms": {"field3": ["1001001"]}}
            ]
          }
        }
      ]
    }
  }
}

 

{
    "query": {
        "bool": {
            "must": {
                //or条件组装
                "bool" : { 
                    "should": [
                        { "match": { "about": "music" }},
                        { "match": { "about": "climb" }} ] 
                }
            },
            "must": {
                "match": { "first_nale": "John" }
            },
            "must_not": {
                "match": {"last_name": "Smith" }
            }
        }
}

 

相关文章:

  • 2021-10-06
  • 2022-12-23
  • 2022-12-23
  • 2021-10-27
  • 2021-09-23
  • 2022-02-25
  • 2021-06-02
  • 2022-02-09
猜你喜欢
  • 2021-07-20
  • 2021-06-25
  • 2022-01-24
  • 2022-12-23
  • 2021-12-05
  • 2021-11-24
  • 2022-12-23
相关资源
相似解决方案