lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niklas Langvig <>
Subject SV: configuring schema to match database
Date Fri, 11 Jan 2013 14:10:23 GMT
Hmm noticed I wrote I have 3 columns: users, courses and languages
I ofcourse mean I have 3 tables: users, courses and languages


-----Ursprungligt meddelande-----
Från: Niklas Langvig [] 
Skickat: den 11 januari 2013 14:19
Ämne: configuring schema to match database

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

View raw message