lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsmiley <...@git.apache.org>
Subject [GitHub] lucene-solr pull request #382: WIP: SOLR-12361
Date Thu, 24 May 2018 03:45:43 GMT
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-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message