The requested URL was not found on this server. 不管你信不信,反正我是没找到

字段的mapping type设置为keyword后,数值不能被匹配到

Elasticsearch | 作者 MoFanDon | 发布于2018年04月20日 | 阅读数:3787

今天遇到这样的问题:字段的mapping type设置为keyword后,数值不能被匹配到 ,大家有遇到过么?
如下:
 
---mapping {
    "properties": {
        "test": {
            "type": "keyword"
        }
}
}
 
---存了一条这个数据
"_source": {
          "test": 565
        }
 
--查询 不到

 {
  "query": {
    "match": {
      "test": 565
    }
  }

 
 
 
 
 
已邀请:

rockybean - Elastic Certified Engineer, ElasticStack Fans,公众号:ElasticTalk

赞同来自: MoFanDon

你用 term 就可以了,match 被分词了

要回复问题请先登录注册