Elasticsearch mapping

//设置mapping

Put: http://192.168.1.102:9200/indexName

{
  "settings": {
    "number_of_shards": 1,
    "number_of_replicas": 0
  },
  "mappings": {
    "typeName": {
      "properties": {
        "sno": {
          "type": "string"
        },
        "sname": {
          "type": "string",
          "index": "not_analyzed"
        }
      }
    }
  }
}

//返回
{
    "acknowledged": true
}

//修改mapping

Put: http://192.168.1.102:9200/indexName/typeName/_mapping/

{
  "typeName": {
    "properties": {
      "sno": {
        "type": "string",
        "index": "not_analyzed"
      }
    }
  }
}


{
    "acknowledged": true
}
原文地址:https://www.cnblogs.com/valor-xh/p/6250242.html