lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From no...@apache.org
Subject svn commit: r785965 - /lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java
Date Thu, 18 Jun 2009 08:59:46 GMT
Author: noble
Date: Thu Jun 18 08:59:46 2009
New Revision: 785965

URL: http://svn.apache.org/viewvc?rev=785965&view=rev
Log:
SOLR-1228

Modified:
    lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java

Modified: lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java?rev=785965&r1=785964&r2=785965&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java
(original)
+++ lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java
Thu Jun 18 08:59:46 2009
@@ -272,6 +272,20 @@
     Iterator<Map<String, Object>> iter = deletedKeys.iterator();
     while (iter.hasNext()) {
       Map<String, Object> map = iter.next();
+      Object key = null;
+      if(root.pk != null){
+        key = map.get(root.pk);
+      }
+      if(key == null && map.size() ==1){
+        for (Map.Entry<String, Object> e : map.entrySet()) {
+          key = e.getValue();
+          break;
+        }
+      }
+      if(key == null) {
+        LOG.warn("no key was available for deleteted pk query");
+        continue;
+      }
       writer.deleteDoc(map.get(root.pk));
       importStatistics.deletedDocCount.incrementAndGet();      
       iter.remove();



Mime
View raw message