When thinkting some more,
Perhaps I could have coursename and such as multivalue?

Or should I have separate indeces for users, courses and languages?

I get the feeling both would work, but now sure which way is the best to go.

When a user is updating/removing/adding a course it would be nice to to have to 
query the database for users courses and languages and update everything but 
just update a course document
But perhaps I'm thinking to much in database terms?

But still I'm unsure how the schema should look like

Thanks
/Niklas

-----Ursprungligt meddelande-----
Från: Niklas Langvig [mailto:niklas.lang...@globesoft.com] 
Skickat: den 11 januari 2013 14:19
Till: solr-user@lucene.apache.org
Ämne: configuring schema to match database

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

Reply via email to