uniqueidentifier - Solr Cluster + DataImportHandler: can I have autogenerated id? -


i'm using solr 4.3. i've created 4 shards. configured uniquekey autogenerated field described here:

http://wiki.apache.org/solr/uniquekey

it works fine if use actual update handler insert documents (i.e. if make http post /update json data, unique key autogenerated each document).

if use dataimporthandler pull documents database, not added index, instead see warning in solr log saying "mandatory id field missing".

i know dataimporthandler doesn't go through updatehandler add documents, hoping feature work dih well...

so question is: know how make work id autogeneration solr 4.3 cluster when using dataimporthandler insert documents?

well, solution ended using this

  • created custom transformer in java (actually using 1 - find it's faster doing them in js - other option solr offers)
  • inside transformer pretty uuidupdateprocessorfactory does: add

    @override public object transformrow(map<string, object> row, context context) {     row.put("id", uuid.randomuuid()); 
  • i removed <updaterequestprocessorchain name="uuid"> tag solrconfig.xml, , left schema.xml configuration per link in question


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -