lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kaushik <kaushika...@gmail.com>
Subject Re: generate uuid/ id for table which do not have any primary key
Date Thu, 16 Apr 2015 18:38:20 GMT
You seem to have defined the field, but not populating it in the query. Use
a combination of fields to come up with a unique id that can be assigned to
uuid. Does that make sense?

Kaushik

On Thu, Apr 16, 2015 at 2:25 PM, Vishal Swaroop <vishal.rec@gmail.com>
wrote:

> How to generate uuid/ id (maybe in data-config.xml...) for table which do
> not have any primary key.
>
> Scenario :
> Using DIH I need to import data from database but table does not have any
> primary key
> I do have uuid defined in schema.xml and is
> <field name="uuid" type="uuid" indexed="true" stored="true" required="true"
> multiValued="false"/>
> <uniqueKey>uuid</uniqueKey>
>
> data-config.xml
> <?xml version="1.0" encoding="UTF-8" ?>
> <dataConfig>
> <dataSource
>   batchSize="2000"
>   name="test"
>   type="JdbcDataSource"
>   driver="oracle.jdbc.OracleDriver"
>   url="jdbc:oracle:thin:@ldap:...."
>   user="myUser"
>   password="pwd"/>
> <document>
> <entity name="test_entity"
>   docRoot="true"
>   dataSource="test"
>   query="select name, age from test_user">
> </entity>
> </document>
> </dataConfig>
>
> Error : Document is missing mandatory uniqueKey field: uuid
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message