Github user dsmiley commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/395#discussion_r193785664
--- Diff: solr/core/src/java/org/apache/solr/handler/loader/JsonLoader.java
---
@@ -668,7 +682,40 @@ private boolean isChildDoc(SolrInputDocument
extendedMap) {
return
extendedMap.containsKey(req.getSchema().getUniqueKeyField().getName());
}
- private SolrInputDocument generateExtendedValueMap(int ev) throws
IOException {
+ private boolean entryIsChildDoc(Object val) {
+ if(val instanceof List) {
+ List listVal = (List) val;
+ if (listVal.size() == 0) return false;
+ return listVal.get(0) instanceof Map;
+ }
+ return val instanceof Map;
+ }
+
+ private void safeAddValue(SolrInputDocument doc, String fieldName,
Object value) {
--- End diff --
I'm confused why this is necessary. What goes wrong if
doc.addField(name,value) is called? If something goes wrong and this is
necessary, that explanation needs to be in the comments.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]