Hi Niklas, Maybe this link helps:
http://www.coderthing.com/solr-with-multicore-and-database-hook-part-1/ D. On Fri, Jan 11, 2013 at 2:19 PM, Niklas Langvig < niklas.lang...@globesoft.com> wrote: > Hi! > I'm quite new to solr and trying to understand how to create a schema from > how our postgres database and then search for the content in solr instead > of querying the db. > > My question should be really easy, it has most likely been asked many > times but still I'm not able to google any answer to it. > > To make it easy, I have 3 columns: users, courses and languages > > Users has columns , userid, firstname, lastname > Courses has column coursename, startdate, enddate > Languages has column language, writingskill, verbalskill > > UserA has taken courseA, courseB and courseC and has writingskill good > verbalskill good for english and writingskill excellent verbalskill > excellent for spanish > UserB has taken courseA, courseF, courseG and courseH and has writingskill > fluent verbalskill fluent for english and writingskill good verbalskill > good for italian > > I would like to put this data into solr so I can search for all "users how > have taken courseA and are fluent in english". > Can I do that? > > The problem is I'm not sure how to flatten this database into a schema > It's easy to understand the users column, for example > <field name="userid" type="string" indexed="true" /> > <field name="firstname" type="string" indexed="true" /> > <field name="lastname" type="string" indexed="true" /> > > But then I'm not so sure how the schema should look like for courses and > languages > <field name="userid" type="string" indexed="true" /> > <field name="coursename" type="string" indexed="true" /> > <field name="startdate" type="string" indexed="true" /> > <field name="enddate" type="string" indexed="true" /> > > > Thanks for any help > /Niklas >