lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From no...@apache.org
Subject svn commit: r788587 - in /lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport: DocBuilder.java EntityProcessorWrapper.java
Date Fri, 26 Jun 2009 05:44:26 GMT
Author: noble
Date: Fri Jun 26 05:44:26 2009
New Revision: 788587

URL: http://svn.apache.org/viewvc?rev=788587&view=rev
Log:
SOLR-1229 deletedPkQuery feature does not work when pk and uniqueKey field do not have the
same value

Modified:
    lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java
    lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorWrapper.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=788587&r1=788586&r2=788587&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
Fri Jun 26 05:44:26 2009
@@ -277,6 +277,7 @@
         key = map.get(root.pk);
       }
       if(key == null && map.size() ==1){
+        //iterating through the map just to get the first and only item
         for (Map.Entry<String, Object> e : map.entrySet()) {
           key = e.getValue();
           break;
@@ -286,7 +287,7 @@
         LOG.warn("no key was available for deleteted pk query");
         continue;
       }
-      writer.deleteDoc(map.get(root.pk));
+      writer.deleteDoc(key);
       importStatistics.deletedDocCount.incrementAndGet();      
       iter.remove();
     }

Modified: lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorWrapper.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorWrapper.java?rev=788587&r1=788586&r2=788587&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorWrapper.java
(original)
+++ lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorWrapper.java
Fri Jun 26 05:44:26 2009
@@ -161,6 +161,7 @@
 
   @SuppressWarnings("unchecked")
   protected Map<String, Object> applyTransformer(Map<String, Object> row) {
+    if(row == null) return null;
     if (transformers == null)
       loadTransformers();
     if (transformers == Collections.EMPTY_LIST)
@@ -247,11 +248,17 @@
   }
 
   public Map<String, Object> nextModifiedRowKey() {
-    return delegate.nextModifiedRowKey();
+    Map<String, Object> row = delegate.nextModifiedRowKey();
+    row = applyTransformer(row);
+    rowcache = null;
+    return row;
   }
 
   public Map<String, Object> nextDeletedRowKey() {
-    return delegate.nextDeletedRowKey();
+    Map<String, Object> row = delegate.nextDeletedRowKey();
+    row = applyTransformer(row);
+    rowcache = null;
+    return row;
   }
 
   public Map<String, Object> nextModifiedParentRowKey() {



Mime
View raw message