vinayakphegde commented on code in PR #1448:
URL: https://github.com/apache/solr/pull/1448#discussion_r1135339158


##########
solr/core/src/java/org/apache/solr/handler/loader/XMLLoader.java:
##########
@@ -393,31 +401,35 @@ public SolrInputDocument readDoc(XMLStreamReader parser) 
throws XMLStreamExcepti
             }
             if (!isLabeledChildDoc) {
               // only add data if this is not a childDoc, since it was added 
already
-              doc.addField(name, v);
+              doc.addField(currentFieldName, v);
             } else {
               // reset so next field is not treated as child doc
               isLabeledChildDoc = false;
             }
             // field is over
-            name = null;
+            currentFieldName = null;
           }
           break;
 
         case XMLStreamConstants.START_ELEMENT:
           text.setLength(0);
           String localName = parser.getLocalName();
           if ("doc".equals(localName)) {
-            if (name != null) {
+            if (currentFieldName != null) { // enclosed in <field>
               // flag to prevent spaces after doc from being added
               isLabeledChildDoc = true;
-              if (!doc.containsKey(name)) {
-                doc.setField(name, Lists.newArrayList());

Review Comment:
   Do you want me to revert the changes that you added now?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to