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:12:08 GMT
Hi Dariusz,
To me this  example has one table "user" and I have many tables that connects to one user
and that is what I'm unsure how how to do.


-----Ursprungligt meddelande-----
Från: Dariusz Borowski [] 
Skickat: den 11 januari 2013 14:56
Ämne: Re: configuring schema to match database

Hi Niklas,

Maybe this link helps:


On Fri, Jan 11, 2013 at 2:19 PM, Niklas Langvig <> 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

View raw message