lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MartinS <>
Subject DIH unique solr id field problem
Date Wed, 15 Jun 2011 13:05:08 GMT

I want to perform a data import from a relational database. It has multiple
unrelated tables, each containing rows for the same kind of data. For each
row of every table i want to create a solr document. 
That all works well. 
The trouble is qith creating the solr doc id. The tables are
autoincremented, but because there are more than one, i cannot use this as a
unique id.
So I was thinking to use a combination of the inc id, together with the
table name. That would be fine for me.
I want to dynamically create a unique id for my solr documents while
importing by using my data config file. I cant get it to work, maybe its not
possible this way, but i thought i would ask you ll. 
(I set up schema.xml to use the field "id" as the unique id for solr

My solr config (for 2 tables now...) looks like this : 

                name = "wld" 
        <document name="variants">
          <entity name="III_1_1" query="SELECT * FROM `wld`.`III_1_1`">
            <field column="id" name='${ + "id"}'/>
            <field column="lemmatitel" name="lemma" />
            <field column="vraagtekst" name="vraagtekst" />
            <field column="lexical_variant" name="variant" />
          <entity name="III_1_2" query="SELECT * FROM `wld`.`III_1_2`">
            <field column="id" name='${"III_1_2_" + "id"}'/>
            <field column="lemmatitel" name="lemma" />
            <field column="vraagtekst" name="vraagtekst" />
            <field column="lexical_variant" name="variant" />

For a unique id I would like the concatenate the primary key of the table
(Column id) with the table name. 
How can I do this ? Both ways as shown in the example data config don't work
while importing. 

Any help is appreciated. 

View this message in context:
Sent from the Lucene - General mailing list archive at

View raw message