天天看点

Elasticsearch修改mapping

Elasticsearch 增加字段前,首先增加mapping,仅对索引中以后的数据生效。

POST http://192.168.208.32:9200/testindex/_mapping/data/

{
  "properties": {
    "title": {
      "index": "analyzed",
      "type": "string",
      "fields": {
        "raw": {
          "index": "not_analyzed",
          "type": "string"
        }
      }
    }
  }
}
           

继续阅读