: Is there any way to explicitly add a record using Solr, such that the : add will fail if a record already exists with the same value in the : unique ID field (as specified by the schema's uniqueKey field)?
I was going to say <add allowDups="false" overwritePending="false" overwriteCommitted="false"> should do what you want, http://wiki.apache.org/solr/UpdateXmlMessages#head-3dfbf90fbc69f168ab6f3389daf68571ad614bef ...but that combination of options doesn't seem to be supported -- when i tried to write a test case for it, it failed with this exception... SEVERE: org.apache.solr.core.SolrException: unsupported param combo:add:,allowDups=false,overwritePending=false,overwriteCommitted=false at org.apache.solr.update.DirectUpdateHandler2.addDoc(DirectUpdateHandler2.java:197) ...i'm not sure how hard it would be to add that, the UpdateHandler is already checking for the dumplicate, i'm not sure why it can't just throw the new doc away when it finds one instead of deleting the old (that error message shows some definite forethought, so i'm guessing Yonik had a reason for it). -Hoss