From 32c6c7aad44e58a88f9b627a2f38fd398f14426c Mon Sep 17 00:00:00 2001 From: Ryan McKinley Date: Mon, 21 Mar 2011 20:23:39 +0000 Subject: [PATCH] SOLR-2423 don't add null copy fields git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1083934 13f79535-47bb-0310-9956-ffa450edef68 --- solr/src/java/org/apache/solr/update/DocumentBuilder.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/solr/src/java/org/apache/solr/update/DocumentBuilder.java b/solr/src/java/org/apache/solr/update/DocumentBuilder.java index 86108c60d1a..e78e18d3340 100644 --- a/solr/src/java/org/apache/solr/update/DocumentBuilder.java +++ b/solr/src/java/org/apache/solr/update/DocumentBuilder.java @@ -18,12 +18,10 @@ package org.apache.solr.update; import java.util.ArrayList; -import java.util.Date; import java.util.HashMap; import java.util.List; import org.apache.lucene.document.Document; -import org.apache.lucene.document.Field; import org.apache.lucene.document.Fieldable; import org.apache.solr.common.SolrDocument; import org.apache.solr.common.SolrException; @@ -286,7 +284,7 @@ public class DocumentBuilder { Fieldable [] fields = destinationField.createFields(val, boost); if (fields != null) { // null fields are not added for (Fieldable f : fields) { - out.add(f); + if(f != null) out.add(f); } } }