ご覧いただきありがとうございます。
Elasticsearch 7.1(CentOS7)で、単純なインデックスのマッピングを定義して、その中の
日付フィールドに「RFC3339」形式で入力したらエラーが発生して、日付フォーマットを
書き換えても同じエラーが発生する現象に見舞われてます。
ぜひともアドバイスをよろしくお願いいたします。
前提・実現したいこと
インデックスのマッピングでフィールド名「created_at」(date型)
をRFC3339
形式の日本時間+09:00を加味した手入力したいのが目的です。
マッピングJSON
JSON
1 "mappings": { 2 "properties": { 3 "created_at": { 4 "type": "date", 5 "format": "yyyy-MM-dd'T'HH:mm:ss'+09:00'" 6 }, 7 "id": { 8 "type": "integer", 9 }, 10 "name": { 11 "type": "keyword" 12 } 13 } 14 }
発生している問題・エラーメッセージ
上記の「created_at」のフィールドに「2021-09-08T12:34:56+09:00
」を手入力してPUTすると下記のエラーが発生しました。
JSON
1{ 2 "error" : { 3 "root_cause" : [ 4 { 5 "type" : "mapper_parsing_exception", 6 "reason" : "failed to parse field [created_at] of type [date] in document with id '1'. Preview of field's value: '2021-09-08T12:34:56+09:00'" 7 } 8 ], 9 "type" : "mapper_parsing_exception", 10 "reason" : "failed to parse field [created_at] of type [date] in document with id '1'. Preview of field's value: '2021-09-08T12:34:56+09:00'", 11 "caused_by" : { 12 "type" : "illegal_argument_exception", 13 "reason" : "failed to parse date field [2021-09-08T12:34:56+09:00] with format [yyyy-MM-dd'T'HH:mm:dd+09:00]", 14 "caused_by" : { 15 "type" : "date_time_parse_exception", 16 "reason" : "Text '2021-09-08T12:34:56+09:00' could not be parsed at index 17" 17 } 18 } 19 }, 20 "status" : 400 21 22
あなたの回答
tips
プレビュー