Elasticsearch mapping

时间:2017-01-04 21:58:18   收藏:0   阅读:243

//设置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
}

 

原文:http://www.cnblogs.com/valor-xh/p/6250242.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!