On 16 September 2013 02:47, Baskar Sikkayan <baskar....@gmail.com> wrote: [...] > Have a question now. > > I know in solr its flat file system and the data will be in denormalized > form. > > My question : > > Have 3 tables, > > 1) user (userid, firstname, lastname, ...) > 2) master (masterid, skills, ...) > 3) child (childid, masterid, userid, ...) > > In solr, i have added all these field for each document. > > Example, > > childid,masterid,userid,skills,firstname,lastname > > Real Data Example, > > 1(childid),1(masterid),1(userid),"java,jsp","baskar","sks" > 2(childid),1(masterid),1(userid),"java,jsp","baskar","sks" > 3(childid),1(masterid),1(userid),"java,jsp","baskar","sks"
As people have already advised you, the best way to decide how to organise your data in the Solr index depends on the searches that you want to make. This is not entirely clear from your description above. The flattening sample that you show above would be suitable if the user is to search by 'child' attributes, but can be simplified otherwise. > The above data sample is from solr document. > In my search result, i will have to show all these fields. > > User may change the name at any time.The same has to be updated in solr. > > In this case, i need to find all the child id that belongs to the user and > update the username with those child ids. > > Please tell me if there is any other better approach than this. How would you know that the user name has been changed? Is there a modification date for that table. If so, it would make sense to check that against the last time indexing to Solr was done. A DIH delta-import makes this straightforward. Updates as you suggest above would be the normal way to handle things. You should batch your updates, say by running an update script at periodic intervals. Regards, Gora