Open lqshow opened 6 years ago
布尔查询是最常用的组合查询,不仅将多个查询条件组合在一起,并且将查询的结果和结果的评分组合在一起,所有子查询之间的逻辑关系是与(and)
Bool查询包括四种子句: must,filter, should, must_not。 布尔查询的四个子句,都可以是数组字段
{ "bool" : { "must" : { "term" : { "user" : "kimchy" } }, "filter": { "term" : { "tag" : "tech" } }, "must_not" : { "range" : { "age" : { "from" : 10, "to" : 20 } } }, "should" : [ { "term" : { "tag" : "wow" } }, { "term" : { "tag" : "elasticsearch" } } ], "minimum_should_match" : 1 } }
Overview
Bool查询包括四种子句: must,filter, should, must_not。 布尔查询的四个子句,都可以是数组字段
Example