On 8/20/2015 4:27 PM, CrazyDiamond wrote: > i have a DIH delta-import query based on last_index_time.it works perfectly > But sometimes i add documents to Solr manually and i want DIH not to add > them again.I have UUID unique field and also i have "id" from database which > is marked as pk in DIH schema. my question is : will DIH update existing > document or add new one? > p.s. id field is not marked as unique in config
The pk (primary key) in DIH is only relevant in the context of DIH, and is only used by DIH for validating and coordinating database queries. It has absolutely no impact on the Solr index. If you want a newly indexed document to replace an existing document, the value in the uniqueKey field (defined in schema.xml) must be the same as that field's value in the existing document that you wish to replace. If you have a matching value, Solr will automatically replace the document for you -- the old version will be deleted before the new one is indexed. Thanks, Shawn