Github user moshebla commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/455#discussion_r223359889
--- Diff:
solr/core/src/java/org/apache/solr/update/processor/AtomicUpdateDocumentMerger.java
---
@@ -461,5 +466,33 @@ private static boolean isChildDoc(Object obj) {
}
return objValues.iterator().next() instanceof SolrDocumentBase;
}
+
+ private void removeObj(Collection original, Object toRemove, String
fieldName) {
+ if(isChildDoc(toRemove)) {
+ removeChildDoc(original, (SolrInputDocument) toRemove);
+ } else {
+ original.remove(getNativeFieldValue(fieldName, toRemove));
+ }
+ }
+
+ private static void removeChildDoc(Collection original,
SolrInputDocument docToRemove) {
+ for(SolrInputDocument doc: (Collection<SolrInputDocument>) original) {
+ if(isDerivedFromDoc(doc, docToRemove)) {
+ original.remove(doc);
--- End diff --
I was thinking that if doc {"id": "4"} was supplied, then the **whole**
child doc with that id(4) is to be removed.
Or perhaps you have a different scenario in mind, where a field of a a
particular child document is to be removed while the rest of the child document
is left intact?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]