[GitHub] lucene-solr pull request #395: WIP SOLR-12362: add tests for working relatio...

classic Classic list List threaded Threaded
44 messages Options
123
Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #395: WIP SOLR-12362: add tests for working relatio...

iverase
GitHub user moshebla opened a pull request:

    https://github.com/apache/lucene-solr/pull/395

    WIP SOLR-12362: add tests for working relational docs

   

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/moshebla/lucene-solr SOLR-12362-docsasval

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/lucene-solr/pull/395.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #395
   
----
commit e725d7c5a8bdcc65ea031bb4036e788388fc9af0
Author: user <user@...>
Date:   2018-06-05T12:11:52Z

    SOLR-12362: add tests for working relational docs

----


---

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

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #395: WIP SOLR-12362: add tests for working relatio...

iverase
Github user dsmiley commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/395#discussion_r193216315
 
    --- Diff: solr/core/src/test/org/apache/solr/handler/JsonLoaderTest.java ---
    @@ -946,5 +946,87 @@ public void testGrandChildDocs() throws Exception {
     
       }
     
    +  @Test
    +  public void testRelationalChildDocs() throws Exception {
    --- End diff --
   
    A bit on terminology.... if so-called "relational" child docs are going to be the only way to have a child doc in the future, then lets just start calling these simply child docs without the "relational" qualifier.  "Relational" may be kinda confusing since an anonymous relationship is still related.  Perhaps the new way is a "labelled" child doc?  If you disagree and want to keep some qualifier then okay.  If you see an existing test that says "child doc" for anonymous child doc then change its name to be about "anonymous" child docs.


---

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

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #395: WIP SOLR-12362: add tests for working relatio...

iverase
In reply to this post by iverase
Github user dsmiley commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/395#discussion_r193217004
 
    --- Diff: solr/core/src/java/org/apache/solr/handler/loader/JsonLoader.java ---
    @@ -556,82 +556,105 @@ private void parseFieldValue(SolrInputField sif) throws IOException {
           if (ev == JSONParser.OBJECT_START) {
             parseExtendedFieldValue(sif, ev);
           } else {
    -        Object val = parseNormalFieldValue(ev, sif.getName());
    +        Object val = parseNormalFieldValue(ev, sif);
             sif.setValue(val);
           }
         }
     
    +    private Map<String, Object> generateExtendedValueMap(int ev) throws IOException {
    +      assert ev == JSONParser.OBJECT_START;
    +      Map<String, Object> extendedInfo = new HashMap<>();
    +
    +      for(; ; ) {
    --- End diff --
   
    nitpick: I prefer while(true)


---

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

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #395: WIP SOLR-12362: add tests for working relatio...

iverase
In reply to this post by iverase
Github user dsmiley commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/395#discussion_r193216812
 
    --- Diff: solr/core/src/java/org/apache/solr/handler/loader/JsonLoader.java ---
    @@ -556,82 +556,105 @@ private void parseFieldValue(SolrInputField sif) throws IOException {
           if (ev == JSONParser.OBJECT_START) {
             parseExtendedFieldValue(sif, ev);
           } else {
    -        Object val = parseNormalFieldValue(ev, sif.getName());
    +        Object val = parseNormalFieldValue(ev, sif);
             sif.setValue(val);
           }
         }
     
    +    private Map<String, Object> generateExtendedValueMap(int ev) throws IOException {
    --- End diff --
   
    Can you please sequence the methods so this follows where it's called from so readers needn't look back up?


---

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

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #395: WIP SOLR-12362: add tests for working relatio...

iverase
In reply to this post by iverase
Github user dsmiley commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/395#discussion_r193217572
 
    --- Diff: solr/core/src/java/org/apache/solr/handler/loader/JsonLoader.java ---
    @@ -556,82 +556,105 @@ private void parseFieldValue(SolrInputField sif) throws IOException {
           if (ev == JSONParser.OBJECT_START) {
             parseExtendedFieldValue(sif, ev);
           } else {
    -        Object val = parseNormalFieldValue(ev, sif.getName());
    +        Object val = parseNormalFieldValue(ev, sif);
             sif.setValue(val);
           }
         }
     
    +    private Map<String, Object> generateExtendedValueMap(int ev) throws IOException {
    +      assert ev == JSONParser.OBJECT_START;
    +      Map<String, Object> extendedInfo = new HashMap<>();
    +
    +      for(; ; ) {
    +        ev = parser.nextEvent();
    +        if (ev == JSONParser.OBJECT_END) {
    +          return extendedInfo;
    +        }
    +        String label = parser.getString();
    +        SolrInputField sif = new SolrInputField(label);
    +        parseFieldValue(sif);
    +        extendedInfo.put(label, sif.getValue());
    +      }
    +    }
    +
    +    private boolean isChildDoc(Map<String, Object> extendedMap) {
    +      if (extendedMap.containsKey("value") && extendedMap.containsKey("boost")) {
    --- End diff --
   
    lets instead simply check for the uniqueKey label


---

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

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr issue #395: WIP SOLR-12362: add tests for working relational doc...

iverase
In reply to this post by iverase
Github user dsmiley commented on the issue:

    https://github.com/apache/lucene-solr/pull/395
 
    Looks good!


---

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

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #395: WIP SOLR-12362: add tests for working relatio...

iverase
In reply to this post by iverase
Github user dsmiley commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/395#discussion_r193532042
 
    --- Diff: solr/core/src/java/org/apache/solr/handler/loader/JsonLoader.java ---
    @@ -661,13 +664,13 @@ private Object parseSingleFieldValue(int ev, SolrInputField sif) throws IOExcept
           }
         }
     
    -    private boolean isChildDoc(Map<String, Object> extendedMap) {
    +    private boolean isChildDoc(SolrInputDocument extendedMap) {
           return extendedMap.containsKey(req.getSchema().getUniqueKeyField().getName());
         }
     
    -    private Map<String, Object> generateExtendedValueMap(int ev) throws IOException {
    +    private SolrInputDocument generateExtendedValueMap(int ev) throws IOException {
    --- End diff --
   
    this method name is no longer appropriate


---

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

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #395: WIP SOLR-12362: add tests for working relatio...

iverase
In reply to this post by iverase
Github user dsmiley commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/395#discussion_r193789756
 
    --- Diff: solr/solrj/src/java/org/apache/solr/common/util/JsonRecordReader.java ---
    @@ -438,18 +442,19 @@ void walkObject() throws IOException {
           }
         }
     
    -    private void addChildDoc2ParentDoc(Map<String, Object> record, Map<String, Object> values) {
    +    private void addChildDoc2ParentDoc(Map<String, Object> record, Map<String, Object> values, String path) {
    +      String trimmedPath = trimPath(path);
    --- End diff --
   
    I think "path" should be renamed "key", and the trimPath() should be done by the caller, and not be called trimPath either for that matter -- it takes the "leaf" or "suffix" part of the path, or perhaps you have an idea of a better name.


---

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

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #395: WIP SOLR-12362: add tests for working relatio...

iverase
In reply to this post by iverase
Github user dsmiley commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/395#discussion_r193783038
 
    --- Diff: solr/core/src/java/org/apache/solr/handler/loader/JsonLoader.java ---
    @@ -249,14 +251,27 @@ public void handle(Map<String, Object> record, String path) {
         private SolrInputDocument buildDoc(Map<String, Object> m) {
           SolrInputDocument result = new SolrInputDocument();
           for (Map.Entry<String, Object> e : m.entrySet()) {
    -        if (e.getKey() == null) {// special case. JsonRecordReader emits child docs with null key
    +        if (entryIsChildDoc(e.getValue())) {// special case. JsonRecordReader emits child docs with null key
               if (e.getValue() instanceof List) {
                 List value = (List) e.getValue();
                 for (Object o : value) {
    -              if (o instanceof Map) result.addChildDocument(buildDoc((Map) o));
    +              if (o instanceof Map) {
    +                if (anonChildDocFlag) {
    +                  result.addChildDocument(buildDoc((Map) o));
    +                } else {
    +                  if(!result.containsKey(e.getKey())) {
    +                    result.setField(e.getKey(), new ArrayList<>(1));
    --- End diff --
   
    This looks unnecessary; SolrInputDocument internally handles ensuring multiple values can be captures.


---

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

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #395: WIP SOLR-12362: add tests for working relatio...

iverase
In reply to this post by iverase
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #395: WIP SOLR-12362: add tests for working relatio...

iverase
In reply to this post by iverase
Github user dsmiley commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/395#discussion_r193783399
 
    --- Diff: solr/core/src/java/org/apache/solr/handler/loader/JsonLoader.java ---
    @@ -249,14 +251,27 @@ public void handle(Map<String, Object> record, String path) {
         private SolrInputDocument buildDoc(Map<String, Object> m) {
           SolrInputDocument result = new SolrInputDocument();
           for (Map.Entry<String, Object> e : m.entrySet()) {
    -        if (e.getKey() == null) {// special case. JsonRecordReader emits child docs with null key
    +        if (entryIsChildDoc(e.getValue())) {// special case. JsonRecordReader emits child docs with null key
    --- End diff --
   
    the comment is concerning; we don't want JsonRecordReader to do that anymore?


---

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

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #395: WIP SOLR-12362: add tests for working relatio...

iverase
In reply to this post by iverase
Github user dsmiley commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/395#discussion_r193786291
 
    --- Diff: solr/core/src/test/org/apache/solr/handler/JsonLoaderTest.java ---
    @@ -435,61 +435,80 @@ public void testJsonDocFormat() throws Exception{
     
       public void testFewParentsJsonDoc() throws Exception {
         String json = PARENT_TWO_CHILDREN_JSON;
    +    assertFewParents(json, true);
    +    tearDown();
    --- End diff --
   
    I'm don't think I've ever seen a test do this, and I don't think we should start now.  Simply add two test methods, one that passes true, one that passes false.  test methods need to be named differently of course.  This pattern in testing is pretty common.


---

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

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #395: WIP SOLR-12362: add tests for working relatio...

iverase
In reply to this post by iverase
Github user moshebla commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/395#discussion_r194245379
 
    --- Diff: solr/core/src/java/org/apache/solr/handler/loader/JsonLoader.java ---
    @@ -249,14 +251,27 @@ public void handle(Map<String, Object> record, String path) {
         private SolrInputDocument buildDoc(Map<String, Object> m) {
           SolrInputDocument result = new SolrInputDocument();
           for (Map.Entry<String, Object> e : m.entrySet()) {
    -        if (e.getKey() == null) {// special case. JsonRecordReader emits child docs with null key
    +        if (entryIsChildDoc(e.getValue())) {// special case. JsonRecordReader emits child docs with null key
    --- End diff --
   
    I changed the dictionary implementation to insert child documents into the map under their key, instead of null, so their relation to the parent document can be saved and used when SolrInputDocument is constructed.


---

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

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #395: WIP SOLR-12362: add tests for working relatio...

iverase
In reply to this post by iverase
Github user moshebla commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/395#discussion_r194245516
 
    --- 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 tried the same method, except because SolrInputDocument implements iterable, each document key is added, instead of the SolrInputDocument object. This chain of event occurs because [SolrInputDocument.addField](https://github.com/moshebla/lucene-solr/blob/3c51c1c414c6f7cb359e3ef442ca706e33cf3a7a/solr/solrj/src/java/org/apache/solr/common/SolrInputDocument.java#L84) calls [SolrInputField.addValue](https://github.com/moshebla/lucene-solr/blob/3c51c1c414c6f7cb359e3ef442ca706e33cf3a7a/solr/solrj/src/java/org/apache/solr/common/SolrInputField.java#L91).


---

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

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #395: WIP SOLR-12362: add tests for working relatio...

iverase
In reply to this post by iverase
Github user moshebla commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/395#discussion_r194245569
 
    --- Diff: solr/core/src/java/org/apache/solr/handler/loader/JsonLoader.java ---
    @@ -249,14 +251,27 @@ public void handle(Map<String, Object> record, String path) {
         private SolrInputDocument buildDoc(Map<String, Object> m) {
           SolrInputDocument result = new SolrInputDocument();
           for (Map.Entry<String, Object> e : m.entrySet()) {
    -        if (e.getKey() == null) {// special case. JsonRecordReader emits child docs with null key
    +        if (entryIsChildDoc(e.getValue())) {// special case. JsonRecordReader emits child docs with null key
               if (e.getValue() instanceof List) {
                 List value = (List) e.getValue();
                 for (Object o : value) {
    -              if (o instanceof Map) result.addChildDocument(buildDoc((Map) o));
    +              if (o instanceof Map) {
    +                if (anonChildDocFlag) {
    +                  result.addChildDocument(buildDoc((Map) o));
    +                } else {
    +                  if(!result.containsKey(e.getKey())) {
    +                    result.setField(e.getKey(), new ArrayList<>(1));
    --- End diff --
   
    It can handle it internally, but we have to ensure a JSON list is added as a list of one document, and not as a single document, to remain true to the original JSON document.


---

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

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr issue #395: WIP SOLR-12362: add tests for working relational doc...

iverase
In reply to this post by iverase
Github user moshebla commented on the issue:

    https://github.com/apache/lucene-solr/pull/395
 
    Hopefully these new commits address the problems with the previous changes


---

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

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #395: WIP SOLR-12362: add tests for working relatio...

iverase
In reply to this post by iverase
Github user dsmiley commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/395#discussion_r194444902
 
    --- 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 --
   
    Okay I see.  Interesting -- there are clearly pros/cons to having SolrInputDocument implement core JDK abstractions.  It makes working with it easier, though now some things like what you see here happens automatically when we don't want it to.
   
    There is no perfect solution here but I'd rather see SolrInputField.addValue do an instanceof check when it sees that `v` implements Iterable to guard against iterating the child doc.  This is much smaller/simpler than your safeAddValue, and it's something that won't be tied to Json or any other input format.  Even someone who wants to use SolrJ and thinks that they can just call set/addValue would be surprised it doesn't work unless we make the change at SolrInputField.
    Also admittedly, this is a gotcha to the path of putting nested child docs in values, but not a big deal.


---

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

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #395: WIP SOLR-12362: add tests for working relatio...

iverase
In reply to this post by iverase
Github user dsmiley commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/395#discussion_r194445760
 
    --- Diff: solr/core/src/java/org/apache/solr/handler/loader/JsonLoader.java ---
    @@ -249,14 +251,27 @@ public void handle(Map<String, Object> record, String path) {
         private SolrInputDocument buildDoc(Map<String, Object> m) {
           SolrInputDocument result = new SolrInputDocument();
           for (Map.Entry<String, Object> e : m.entrySet()) {
    -        if (e.getKey() == null) {// special case. JsonRecordReader emits child docs with null key
    +        if (entryIsChildDoc(e.getValue())) {// special case. JsonRecordReader emits child docs with null key
               if (e.getValue() instanceof List) {
                 List value = (List) e.getValue();
                 for (Object o : value) {
    -              if (o instanceof Map) result.addChildDocument(buildDoc((Map) o));
    +              if (o instanceof Map) {
    +                if (anonChildDocFlag) {
    +                  result.addChildDocument(buildDoc((Map) o));
    +                } else {
    +                  if(!result.containsKey(e.getKey())) {
    +                    result.setField(e.getKey(), new ArrayList<>(1));
    --- End diff --
   
    ok so you are trying to retain the semantic information that the input was an array (potentially multi-valued) even if the particular input doc only had one value.  Maybe say more or that, hinting at why we even care.  (why do we care)?  For regular field values, we don't at this level -- the schema holds multiValue info so it's dealth with later.  Again I'm liking my suggestion of putting a virtual child doc field in the schema as it addresses the desire to know this semantic info, plus I think it may add some consistency (avoids special case you're doing here)


---

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

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #395: WIP SOLR-12362: add tests for working relatio...

iverase
In reply to this post by iverase
Github user dsmiley commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/395#discussion_r194446507
 
    --- Diff: solr/solrj/src/java/org/apache/solr/common/util/JsonRecordReader.java ---
    @@ -442,19 +442,18 @@ void walkObject() throws IOException {
           }
         }
     
    -    private void addChildDoc2ParentDoc(Map<String, Object> record, Map<String, Object> values, String path) {
    -      String trimmedPath = trimPath(path);
    +    private void addChildDoc2ParentDoc(Map<String, Object> record, Map<String, Object> values, String key) {
    --- End diff --
   
    much better; thanks


---

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

Reply | Threaded
Open this post in threaded view
|

[GitHub] lucene-solr pull request #395: WIP SOLR-12362: add tests for working relatio...

iverase
In reply to this post by iverase
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: [hidden email]
For additional commands, e-mail: [hidden email]

123