每个布尔查询子句可以包含多个子句。字词查询(http://www.elasticsearch.org/guide/reference/query-
dsl/terms-query/)是一种指定查询应与任何字词列表匹配的简便方法。除了使用之前的ID查询,以下使用术语查询说水果必须是橙色,苹果,梨和颜色之一必须是红色,黄色,绿色之一。
{ "query": { "bool": { "must": [ { "ids": { "type": "foo", "values": [ "fff", "bar", "baz" ] } }, { "terms": { "fruit": [ "orange", "apple","pear" ], "minimum_should_match": 1 } }, { "terms": { "color": [ "red", "yellow", "green" ], "minimum_should_match": 1 } } ] } }}


