mkhludnev commented on code in PR #1448:
URL: https://github.com/apache/solr/pull/1448#discussion_r1135246418
##########
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:
this is the slight loose in logic, but I think it's ok.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]