1. 程式人生 > >ElasticSearch增加Mapping及Mapping欄位

ElasticSearch增加Mapping及Mapping欄位

2.3.x

建立Mapping

POST  /new_test/record/_mapping/
{
	"record": {
		"properties": {
			"analyze_date": {
				"format": "yyyy-MM-dd HH:mm:ss",
				"type": "date"
			},
			"upload_status": {
				"index": "not_analyzed",
				"type": "string"
			},
			"event_type": {
				"index": "not_analyzed",
				"type": "string"
			}
		}
	}
}

 

 

新增Mapping欄位:

 

 

PUT /test_index/_mapping/test_type    mapping增加欄位

{
  "properties": {
    "proRemark": {
      "type": "string",
      "index": "not_analyzed"
    }
  }
}

 

5.0.x

 

新增Mapping欄位:

POST

test_index/test_type/_mapping 

 

刪除type資料:


POST edemo/test/_delete_by_query?conflicts=proceed
{
  "query": {
    "match_all": {}
  }