Github user moshebla commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/395#discussion_r194689072
  
    --- 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 --
    
    So if I understood correctly, I also thought of checking to see if the 
addField value is of SolrDocumentBase, to prevent going through the iterator. I 
was afraid of backwards compatibility, but after some thought, until 
[SOLR-12361](https://issues.apache.org/jira/browse/SOLR-12361) childDocuments 
inside doc keys was not supported.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to