我有映射索引:
GET /warhammer/_mapping
给我:
{
"warhammer": {
"mappings": {
"logs": {
"properties": {
"@timestamp": {
"type": "date",
"format": "dateOptionalTime"
},
"@version": {
"type": "string"
},
"HostName": {
"type": "string"
},
"boosters": {
"type": "long"
},
"device_model": {
"type": "string"
},
"build_type": {
"type": "string"
}....
}
我需要将字段device_model
的映射更改为not_analysed
!
我试过了:
PUT /warhammer/_mapping
{
"device_model": { "type": "string",
"fields": { "raw":
{ "type": "string", "index": "not_analyzed" } } }
}
和此:
PUT /warhammer/_mapping
{
"device_model": {
"type": "string",
"fields":
{ "raw":
{ "type": "string",
"index": "not_analyzed" }
}
}
}
但它给了我:
{
"error": "ActionRequestValidationException[Validation Failed: 1: mapping type is missing;]",
"status": 400
}
我做错了什么?求救!
答案 0 :(得分:1)
PUT /warhammer/_mapping/logs
{
"properties": {
"device_model": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}