ElasticSearch查询过滤语句

database是index名,table是type名

elasticsearch推荐先过滤后查询,下面语句就是如此。

“filter”代表过滤,支持多条件过滤,"trems"表示并集过滤,"trems"表示交集过滤。

“must”代表匹配,不支持多条件。

GET database/table/_search{
	"query":{
		"bool":{
			"filter":[
				{
					"trems":{
						"属性":{
							["value","value"]
						}
					}
				}
				,{
					"trem":{
						"属性":"VALUE"
					}
				},
				{
					"trem":{
						"属性":"VALUE"
					}
				}
			]
			,"must":[{
				"match":{
					"id":"6"
				}
			}]
		}
	}
}

愿你心如花木,向阳而生

猜你喜欢

转载自blog.csdn.net/nbcsdn/article/details/104262519