I am getting a illegal_argument_exception error on a new and empty index
iam new to elasticsearch so I am guessing I misuse the keyword feature I want to be able to aggregate the VisitorDeviceOs field
this is my mapping
{
"mappings":{
"properties":{
"Id":{
"type":"integer"
},
"VisitorDeviceOs":{
"type":"keyword","null_value": "NULL"
},
}
}
}
this is the PUT request to insert the new document
{
"Id":18858,
"VisitorDeviceOs":"Windows",
}
full error:
{
"error" : {
"root_cause" : [
{
"type" : "illegal_argument_exception",
"reason" : "mapper [VisitorDeviceOs] cannot be changed from type [keyword] to [text]"
}
],
"type" : "illegal_argument_exception",
"reason" : "mapper [VisitorDeviceOs] cannot be changed from type [keyword] to [text]"
},
"status" : 400
}