SOLR-1229 deletedPkQuery feature does not work when pk and uniqueKey field do not have the same value

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@788587 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Noble Paul 2009-06-26 05:44:26 +00:00
parent c51a5a2574
commit 49ff8d7775
2 changed files with 11 additions and 3 deletions

View File

@ -277,6 +277,7 @@ public class DocBuilder {
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 @@ public class DocBuilder {
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();
}

View File

@ -161,6 +161,7 @@ public class EntityProcessorWrapper extends EntityProcessor {
@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 class EntityProcessorWrapper extends EntityProcessor {
}
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() {