【发布时间】:2017-08-04 13:29:12
【问题描述】:
我最初的映射是
{
"vehiclemodel": {
"properties": {
"price": {
"type": "double"
}
}
}
}
后来我更新了下面的映射
{
"vehiclemodel": {
"properties": {
"price": {
"type": "double",
"fields": {
"exShowroomPrice": {
"type": "double"
}
}
}
}
}
}
现在,当我添加 Data1 时,它会被添加,但是当我添加 Data2 时,它会抛出异常
数据1:
{
"price": 36992043
}
数据2:
{
"price": {
"exShowroomPrice": 36992043
}
}
例外:
{
'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]'
}
}
}
}
我的收藏vehiclemodel 在 MongoDB 中有这两种类型的数据。我正在使用 mongo-connector 来同步数据 btw mongo 和 ES。当我尝试同步时,出现上述异常
【问题讨论】:
标签: elasticsearch elasticsearch-plugin elasticsearch-5