Elasticsearch 多字段值匹配

GET /data_stat_index/_search
{ "query":{ "bool":{ "must":[ { "match":{ "category":"rdfdb" } }, { "match":{ "region":"CN2" } }, { "match":{ "vendor":"AUTONAVI" } }, { "match":{ "name":"cn_axf_17q3"} } ] } } }

  利用elasticsearch 查询多个字段的值:

must 表示下面所有条件满足;

match 匹配某字段, 是查询的是具有解析类型的字段;https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html#query-dsl-match-query-fuzziness。

Elasticsearch 6 以后 具有解析类型的字段为 text, 不具有解析类型的字段为keyword. 默认会为text类型的字段创建 keyword类型的field

posted @ 2018-03-31 11:19  百变小超  阅读(2809)  评论(1编辑  收藏  举报