My initial mapping was
{
"vehiclemodel": {
"properties": {
"price": {
"type": "double"
}
}
}
}
Later I updated the mapping with below
{
"vehiclemodel": {
"properties": {
"price": {
"type": "double",
"fields": {
"exShowroomPrice": {
"type": "double"
}
}
}
}
}
}
Now when I add Data1 it getting added, but when I add Data2 it throws below exception
Data1 :
{
"price": 36992043
}
Data2 :
{
"price": {
"exShowroomPrice": 36992043
}
}
Exception :
{
'index': {
'_index': 'notes',
'_type': 'vehiclemodel',
'_id': 'fb85823a-021b-468c-91d9-8db5f001ee06',
'status': 400,
'error': {
'type': 'mapper_parsing_exception',
'reason': 'failed to parse [price]',
'caused_by': {
'type': 'json_parse_exception',
'reason': 'Current token (START_OBJECT) not numeric, can not use numeric value accessors\n at [Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper@6e2393ee; line: 1, column: 277]'
}
}
}
}
My collectionvehiclemodel
has both type of data in MongoDB. I am using mongo-connector to sync data btw mongo and ES. When I try to sync I get the above exception