Github user dsmiley commented on a diff in the pull request: https://github.com/apache/lucene-solr/pull/382#discussion_r190457103 --- Diff: solr/solrj/src/java/org/apache/solr/common/SolrDocument.java --- @@ -388,20 +386,47 @@ public void addChildDocuments(Collection<SolrDocument> children) { } } + @Override + public Map<String, Object> getChildDocumentsMap() { + Map<String, Object> childDocs = new HashMap<>(); + for (Entry<String, Object> entry: _fields.entrySet()) { + Object value = entry.getValue(); + if(objIsDocument(value)) { + childDocs.put(entry.getKey(), value); + } + } + return childDocs; + } + /** Returns the list of child documents, or null if none. */ @Override public List<SolrDocument> getChildDocuments() { - return _childDocuments; + List<SolrDocument> childDocs = new ArrayList<>(); + Stream<AbstractMap.SimpleEntry<String, SolrDocument>> fields = _fields.entrySet().stream() + .filter(value -> value.getValue() instanceof SolrInputDocument) --- End diff -- Or the value might be a List of SolrInputDocument, so we have to check for that too; right?
--- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org