Github user dsmiley commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/430#discussion_r207587702
--- Diff: solr/core/src/test/org/apache/solr/update/AddBlockUpdateTest.java
---
@@ -501,6 +501,73 @@ public void testXML() throws IOException,
XMLStreamException {
}
+ @Test
+ public void testXMLLabeledChildren() throws IOException,
XMLStreamException {
--- End diff --
This is a copy-paste of the previous test, but as-such doesn't test that
these labels are retained in any way. In this test, I think you just need to
use the XMLLoader to get a SolrInputDocument, and at that point you can test
that there is a field "test" with these two child documents as values.
I do like that in this test you've displayed the syntax. I was expecting
something like
```
<doc>
<field name='id'>p1</field>
<field name='comment'>
<doc>
<field name='id'>c1</field>
<field name='text'>I like this</field>
</doc>
</field>
</doc>
```
What do you think of that syntax? The intention is to make it super clear
that the child document is attached as a field to the parent document, which is
also reflected in the internal API, and so it's consistent. I haven't looked
at the details of XMLLoader yet to judge how approachable this is. Putting a
"name" attribute on doc isn't bad but makes the "field" relationship un-obvious.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]