moshebla commented on a change in pull request #455: SOLR-12638
URL: https://github.com/apache/lucene-solr/pull/455#discussion_r270655267
 
 

 ##########
 File path: 
solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
 ##########
 @@ -645,32 +660,126 @@ boolean getUpdatedDocument(AddUpdateCommand cmd, long 
versionOnUpdate) throws IO
     }
     
     // full (non-inplace) atomic update
+    final boolean isDeeplyNestedSchema = 
req.getSchema().isUsableForChildDocs() && 
req.getSchema().hasExplicitField(IndexSchema.NEST_PATH_FIELD_NAME);
     SolrInputDocument sdoc = cmd.getSolrInputDocument();
     BytesRef id = cmd.getIndexedId();
-    SolrInputDocument oldDoc = 
RealTimeGetComponent.getInputDocument(cmd.getReq().getCore(), id);
+    SolrInputDocument completeHierarchy = 
RealTimeGetComponent.getInputDocument(cmd.getReq().getCore(), id, 
RealTimeGetComponent.Resolution.ROOT_WITH_CHILDREN);
 
-    if (oldDoc == null) {
-      // create a new doc by default if an old one wasn't found
-      if (versionOnUpdate <= 0) {
-        oldDoc = new SolrInputDocument();
-      } else {
+    if (completeHierarchy == null) {
+      if (versionOnUpdate > 0) {
         // could just let the optimistic locking throw the error
         throw new SolrException(ErrorCode.CONFLICT, "Document not found for 
update.  id=" + cmd.getPrintableId());
       }
     } else {
-      oldDoc.remove(CommonParams.VERSION_FIELD);
+      completeHierarchy.remove(CommonParams.VERSION_FIELD);
     }
 
 
-    cmd.solrDoc = docMerger.merge(sdoc, oldDoc);
+    SolrInputDocument mergedDoc;
 
 Review comment:
   Hmmm fair point.
   I'll try and move the logic there.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to