elasticSearch查询等于多个值

已知存在 service 字段(keyword),则查询 service=’shop’ OR service=’waimai’,

则传递数组 [“shop”, “waimai”]

GET index_name/_search
{
  	"query": {
		"terms": {
			"service": [
				"shop",
				"waimai"
			]
		}
	}
}

多个值过滤,filter => bool=> must => terms =>[ ‘name’ => array($val1,$val2)];

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注