Need help in copy data to ElasticSearch


(prachi sharma) #1

I'm having a small dataset of tweets, the structure of JSON is below and a
file contains multiple JSON objects

{"created_at":"Fri Dec 06 13:00:00 +0000
2013","id":408943910199627778,"id_str":"408943910199627778","text":"\u9ad8\u6728\u3055\u3093\u306e\u3053\u3048\u5143\u592a\u3058\u3083\u306d\n\n\u3061\u3052\u30fc\u304b","source":"\u003ca
href="https://about.twitter.com/products/tweetdeck"
rel="nofollow"\u003eTweetDeck\u003c/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":263559267,"id_str":"263559267","name":"\u3078\u3063\u3049\u306f\u5927\u4e08\u592b\u3058\u3083\u306a\u3044\u3051\u3069\u5927\u4e08\u592b\u3067\u3059","screen_name":"hello4you","location":"\u8eca\u8f2a\u306e\u56fd","url":null,"description":"\u30a2\u30cb\u30e1\u3057\u304b\u898b\u3066\u306a\u3044\u672a\u6765\u3082\u898b\u3066\u306a\u3044\u3002\r\n\u5f10\u5bfaSP\u521d\u6bb5\u306e\u5e95\u8fba\u3001\u30dd\u30c3\u30d7\u30f3\u306f\u30ec\u30d9\u30eb30\u304c\u9650\u754c\u30de\u30f3\u3002\u30ed\u30fc\u30c9\u30e9\u3001\u30d1\u30ba\u30c9\u30e9\u307c\u3061\u307c\u3061\u30003DS\u30d5\u30ec\u30b3\u30000259-1312-2538\r\n\u7d20\u6575\u306a\u30a2\u30a4\u30b3\u30f3\u306f@hello4you\u3055\u3093\u306b\u66f8\u3044\u3066\u3044\u305f\u3060\u304d\u307e\u3057\u305f\uff01\uff01\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\uff01","protected":false,"followers_count":302,"friends_count":386,"listed_count":10,"created_at":"Thu
Mar 10 08:16:42 +0000
2011","favourites_count":778,"utc_offset":32400,"time_zone":"Tokyo","geo_enabled":true,"verified":false,"statuses_count":63363,"lang":"ja","contributors_enabled":false,"is_translator":false,"profile_background_color":"C0DEED","profile_background_image_url":"http://a0.twimg.com/profile_background_images/686949334/e345db29067bd59b463c9be16aef09e8.jpeg","profile_background_image_url_https":"https://si0.twimg.com/profile_background_images/686949334/e345db29067bd59b463c9be16aef09e8.jpeg","profile_background_tile":true,"profile_image_url":"http://pbs.twimg.com/profile_images/378800000829025490/40c2ba6b6aa5ea89ddb609e4f0b4b624_normal.png","profile_image_url_https":"https://pbs.twimg.com/profile_images/378800000829025490/40c2ba6b6aa5ea89ddb609e4f0b4b624_normal.png","profile_banner_url":"https://pbs.twimg.com/profile_banners/263559267/1384989886","profile_link_color":"0084B4","profile_sidebar_border_color":"FFFFFF","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":false,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[]},"favorited":false,"retweeted":false,"filter_level":"medium","lang":"ja"}

How do i import this data in elastic search as there are no indexes in the
data (so can't use bulk data)

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/3ae6373f-24b8-4128-8d61-dc83fd4c38ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Binh Ly-2) #2

You'd probably need to either restructure the file into _bulk format, or
just read the files in code and build/send bulk requests dynamically.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/75e7b458-c659-4186-b52e-36e293368d80%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #3