ElasticSearch多條件查詢

1、查詢message裏同時含有“創建流程,校驗用戶級配額”和“9555b250e0794b91a0b036af8756b53a”的

GET /bcop-2019.09.16/bcop-op-order-manage/_search
{
  "size": 1, 
  "query": {
    "bool": {
      "must": [
        {"match_phrase": {"message": "創建流程,校驗用戶級配額"}},
        {"match_phrase": {"message": "9555b250e0794b91a0b036af8756b53a"}}
      ]
    }
  }
}

2、查詢name是a,city是b或者c的

{
	"query": {
		"bool": {
			"must": [{
				"match_phrase": {
					"name": "a"
				}
			}],
			"should": [{
				"match_phrase": {
					"city": "b"
				}
			},
			{
				"match_phrase": {
					"city": "c"
				}
			}],
			"minimum_should_match": 1
		}
	},
	"size": 5
}


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章