I am migrating mysql data to elasticsearch via logstash. The database is too big and have lots of relations. I already imported the simple tables and table with nested data(single level parent/child) as well.
Problem : I have user, post and comments table. I want all three table into one type as follow.
> {
> "user_id" : 200,
> "user_name" : "john doe",
> "posts" : [
> {
> post_id : 1,
> post_title : "post description",
> "comments" : [
> {
> "comment_id" : 1
> "comment_text" : "good post"
> },
> { "comment_id" : 2
> "comment_text" : "awsome post"
> }
> ]
> },
> {
> post_id : 2,
> post_title : "post description",
> "comments" : [
> {
> "comment_id" : 3
> "comment_text" : "good post"
> },
> { "comment_id" : 4
> "comment_text" : "awsome post"
> }
> ]
> }
> ]
> }
I also want it to be 3 level nested object. if a user upload a pic in comments then that media is a nested object under comments.