Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: General

DIH unique solr id field problem

 

 

Lucene general RSS feed   Index | Next | Previous | View Threaded


martin.snijders at meertens

Jun 15, 2011, 6:05 AM

Post #1 of 1 (203 views)
Permalink
DIH unique solr id field problem

Hello,

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
documents)

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

<dataConfig>
<dataSource
name = "wld"
type="JdbcDataSource"
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/wld"
user="root"
password="pass"/>
<document name="variants">
<entity name="III_1_1" query="SELECT * FROM `wld`.`III_1_1`">
<field column="id" name='${III_1_1.name + "id"}'/>
<field column="lemmatitel" name="lemma" />
<field column="vraagtekst" name="vraagtekst" />
<field column="lexical_variant" name="variant" />
</entity>
<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" />
</entity>
</document>
</dataConfig>

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.
Martin

--
View this message in context: http://lucene.472066.n3.nabble.com/DIH-unique-solr-id-field-problem-tp3067200p3067200.html
Sent from the Lucene - General mailing list archive at Nabble.com.

Lucene general RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.