Mapping:
PUT /my_index/_mapping/blogpost
{
"properties": {
"user": {
"properties": {
"name": {
"type": "string",
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}
}
}
Error:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "mapper [user] of different type, current_type [long], merged_type [ObjectMapper]"
}
],
"type": "illegal_argument_exception",
"reason": "mapper [user] of different type, current_type [long], merged_type [ObjectMapper]"
},
"status": 400
}
Data to be ingested:
PUT /my_index/blogpost/2
{
"title": "Relationships",
"body": "It's complicated...",
"user": {
"id": 1,
"name": "John Smith"
}
}
How should I resolve this mapping Issue?