0
我有波紋管的數據索引:Elasticsearch不允許索引空日期字段
array:6 [▼
"index" => "my_index"
"type" => "audit_field"
"id" => "57f36d28a1dfc"
"parent" => "57f36d289f1b2"
"routing" => 318
"body" => array:19 [▼
"session_id" => 318
"trans_seq_no" => 13
"table_seq_no" => 13
"field_id" => 65
"field_name" => "id"
"new_value" => 45
"old_value" => 45
"date_type_new_value" => null
"date_type_old_value" => null
"time_type_new_value" => null
"time_type_old_value" => null
]
]
我已經定義了自己的映射,波紋管
array(
'index' => 'promote_kmp',
'type' => 'audit_field',
'body' => [
'audit_field' => [
'_source' => [
'type' => 'string'
],
"_parent" => [
"type" => "audit_table"
],
'properties' => [
'session_id' => array('type' => 'string'),
'trans_seq_no' => array('type' => 'string'),
'table_seq_no' => array('type' => 'string'),
'field_id' => array('type' => 'string'),
'field_name' => array('type' => 'string'),
'old_value' => array(
'type' => 'string'
),
'new_value' => array(
'type' => 'string'
),
'date_type_new_value' => array(
'type' => 'date',
'format' =>'YYYY-MM-dd HH:mm:ss||YYYY-MM-dd||MM/dd/yyyy||yyyy/MM/dd'
),
'date_type_old_value' => array(
'type' => 'date',
'format' =>'YYYY-MM-dd HH:mm:ss||YYYY-MM-dd||MM/dd/yyyy||yyyy/MM/dd'
),
'time_type_new_value' => array(
'type' => 'date',
'format' => 'HH:mm:ss'
),
'time_type_old_value' => array(
'type' => 'date',
'format' => 'HH:mm:ss'
)
]
]
]
);
但是,當我婉與空索引數據在日期字段中,elasticsearch顯示和不能使用映射日期格式類型解析日期字段值的異常。 如何解決這個問題,我也嘗試了空的,但不工作,並給出相同的信息。
MapperParsingException[failed to parse [date_type_new_value]]; nested:
MapperParsingException[failed to parse date field [], tried both date format
[YYYY-MM-dd HH:mm:ss||YYYY-MM-dd||MM/dd/yyyy||yyyy/MM/dd], and timestamp
number with locale []]; nested: IllegalArgumentException[Invalid format: ""];
我有控制數據,我已經通過空值,但顯示錯誤。我使用相同版本的彈性。 – jones
這很奇怪,你可以嘗試添加ignore_malformed映射? – ChintanShah25