HI All
I am new to elasticsearch and i am trying to index data from ms sql 
server,i am struggling with constructing structured object,

i have 3 tables blogTable, blogassociation, blogimages 
each lead blog may have multiple images and each blog may may multiple 
embedded blogs
so i want  ES document which looks like this
{
"blogname":title,
"datepublished":"2014-03-12",
 "association":[ 
                       { "blogname":title,
                         "datepublished":"2014-03-12"
                               },.....repeat block ],
"attachments":[
                    {  "leadblogimagecode":1235,
                       "leadblogimagepath":"path_to_image" },repeat block]
}

so my sql query looks like this 
select id as _id,name as "lead.blogname",lead.datepublished as 
"datepublished",embd.blogname as "association[blogname]",datepublished as 
"association[datepublished]",img.id as 
"attachment[leadblogimagecode]",img.path as "attachment[leadblogimagepath]" 
from blogtable lead inner join blogassociation embd on embd.id = lead.id 
inner join blogimages img on img.id = lead.id

result of the above query looks like this
*LeadID Blogname datepublisged embd.id embd.name img.id  img.path    *     
4679        Tesla, Abe and Elba 2014-01-06 00:00:00 3917 Idris Elba 9450 
/web/q/g/h/57436356.jpg 
4679 Tesla, Abe and Elba 2014-01-06 00:00:00 3917 Idris Elba 9965 
/web/i/s/q/GS3193626.jpg
4679 Tesla, Abe and Elba 2014-01-06 00:00:00 3917 Idris Elba 9451 
/web/i/s/q/GS3193626.jpg

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/09900f90-341d-4cf5-b058-f737a5a60807%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to