Github user dsmiley commented on a diff in the pull request: https://github.com/apache/lucene-solr/pull/385#discussion_r191976784 --- Diff: solr/core/src/java/org/apache/solr/update/AddUpdateCommand.java --- @@ -175,69 +172,83 @@ public String getHashableId() { return id; } - public boolean isBlock() { - return solrDoc.hasChildDocuments(); + /** + * @return String id to hash + */ + public String getHashableId() { + return getHashableId(solrDoc); } - @Override - public Iterator<Document> iterator() { - return new Iterator<Document>() { - Iterator<SolrInputDocument> iter; - - { - List<SolrInputDocument> all = flatten(solrDoc); - - String idField = getHashableId(); - - boolean isVersion = version != 0; - - for (SolrInputDocument sdoc : all) { - sdoc.setField(IndexSchema.ROOT_FIELD_NAME, idField); - if(isVersion) sdoc.setField(CommonParams.VERSION_FIELD, version); - // TODO: if possible concurrent modification exception (if SolrInputDocument not cloned and is being forwarded to replicas) - // then we could add this field to the generated lucene document instead. - } - - iter = all.iterator(); - } + public List<SolrInputDocument> computeFlattenedDocs() { --- End diff -- Ok I confess I suggested this name but now I have regrets seeing flatten(). Perhaps computeFinalFlattenedSolrDocs() to convey there is no further manipulation of the docs. And document of course.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org