Hello,

I want to perform a data import from a relational database.
That all works well.
However, 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 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='${variants.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/Need-help-with-DIH-dataconfig-xml-tp3066855p3066855.html
Sent from the Solr - User mailing list archive at Nabble.com.
  • Need help with DIH da... MartinS

Reply via email to