elasticsearch: 创建mapping

elasticsearch版本: 6.5.4

创建mapping

PUT http://192.168.2.136:9200/index_text/_mapping/text/
{
  "dynamic": "false",
  "properties": {
    "id": {
      "type": "keyword"
    },
    "edit_status_t": {
      "type": "text"
    },
    "content_t": {
      "type": "text",
      // 分词-采用单字分词器
      "analyzer": "standard"
    },
    "content_type_t": {
      "type": "text"
    }
    "question_id_t": {
      "type": "keyword"
    }
    "type_txt": {
      "type": "keyword"
    },
    "create_time_dt": {
      "type": "date",
       // 日期格式
      "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
    }
  }
}

添加mapping属性:

PUT http://192.168.2.136:9200/index_text/_mapping/text/
{
  "properties": {
    "update_time_dt": {
      "type": "date",
       // 日期格式
      "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
    }
  }
}

 

posted @ 2019-08-04 17:26  Commissar-Xia  阅读(1901)  评论(0编辑  收藏  举报