prevent Solr "version conflict" on update by set Solr "_version_" field to 0 (=no version check)

pull/1/head
reger 12 years ago
parent acd98bebb7
commit 6cf33f899c

@ -265,8 +265,8 @@ public abstract class SolrServerConnector extends AbstractSolrConnector implemen
public void add(final SolrInputDocument solrdoc) throws IOException, SolrException {
if (this.server == null) return;
try {
if (solrdoc.containsKey("_version_")) solrdoc.setField("_version_",0L); // prevent Solr "version conflict"
synchronized (this.server) {
//this.server.deleteById((String) solrdoc.getFieldValue(YaCySchema.id.getSolrFieldName()));
this.server.add(solrdoc, this.commitWithinMs);
}
} catch (Throwable e) {

Loading…
Cancel
Save