How Can I insert date wrriten in Japanese to the ES?


(kikuchan) #1

Hello.
I'd like to insert date written in Japanese.

I tried to insert date by following command.

curl -XPUT 'http://localhost:9200/posts/post/5’ -d {"contents":"日本語のテストです。","id":"5","name":"斉藤はじめ","userId":"5"}

but It occurred the following error.

{"error":"MppaerParsingExceptuon[failed to parse [contents]]; nested: JsonParseException[Invalid UTF-8 start byte 0x93\n at [Source: [B@61fd643e; line: 1, column: 15]]; "," status":400}

How Can I insert date wrriten in Japanese to the ES?
Could you please help me.


(Jun Ohtani) #2

Which OS do you use?

If JSON is enclosed by single quotes, how about?


(kikuchan) #3

Thanks for your comments.
I used the _bulk API, so I could insert the date written in Japanese.
I guess that this problem attributed to the Encode of the date.

When I created the date,We saved the data in Shift-JIS format.
this is the problem, maybe.

I created the date in UTF-8 format and using _bulk API.
I inserted the date correctly.

thanks for your helping!!

sincerely.


(system) #4