I am using elasticsearch version 6.8.7 with java rest high level client. I coded a program that uses bulk processor to bulk index some data to elasticsearch, according to the documentation provided here.
The problem is when I run my code, response fails with the message:
[type=illegal_argument_exception, reason=object field starting or ending with a [.] makes object resolution ambiguous
which is quite strange because I indexed one of the documents manually and it succeeded without any problem.
this is the part of the code that makes a index request:
String key = entry.getKey();
JSONObject val = entry.getValue();
bulkProcessor.add(new IndexRequest("tweet").type("json").id(key).source(val, XContentType.JSON));
and this is a sample of the json (val in the above):
{"in_reply_to_status_id_str":null,"in_reply_to_status_id":null,"coordinates":null,"created_at":"Mon Apr 06 23:59:47 +0000 2020","truncated":false,"in_reply_to_user_id_str":null,"source":"http://twitter.com/download/iphone\" rel=\"nofollow\">Twitter for iPhone</a>","retweet_count":0,"retweeted":false,"geo":null,"in_reply_to_screen_name":null,"is_quote_status":false,"id_str":"11111111111111","in_reply_to_user_id":null,"favorite_count":7,"id":1111111111111,"text":"something","place":null,"contributors":null,"lang":"en","favorited":false}
If anyone has any ideas why this happens, I would very much appriciate their help.
update: I changed the index nothing changed but this is the error I get in elastic terminal:
object field starting or ending with a [.] makes object resolution ambiguous: [{"possibly_sensitive_appealable":false,"in_reply_to_status_id_str":null,"in_reply_to_status_id":null,"created_at":"Mon Apr 06 23:59:49 +0000 2020","in_reply_to_user_id_str":null,"source":"http://twitter.com/download/android\" rel=\"nofollow\">Twitter for Android</a>","quoted_status_id":1111111111111,"retweet_count":0,"retweeted":false,"geo":null,"in_reply_to_screen_name":null,"is_quote_status":true,"id_str":"111111111111","in_reply_to_user_id":null,"favorite_count":15,"id":1247313090397589511,"text":"something","place":null,"lang":"fa","favorited":false,"possibly_sensitive":false,"coordinates":null,"truncated":false,"quoted_status_id_str":"1111111111111","contributors":null}]
val
that throws an error. As I said, there's nothing wrong with the one you included in your question. – Joe - Elasticsearch Handbook