dsmiley commented on a change in pull request #549: WIP:SOLR-13129
URL: https://github.com/apache/lucene-solr/pull/549#discussion_r253346255
 
 

 ##########
 File path: solr/solr-ref-guide/src/nested-documents.adoc
 ##########
 @@ -0,0 +1,309 @@
+= Nested Child Documents
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+Solr supports indexing nested documents such as a blog post parent document 
and comments as child documents -- or products as parent documents and sizes, 
colors, or other variations as child documents.
+The parent with all children is referred to as a "block" and it explains some 
of the nomenclature of related features.
+At query time, the <<other-parsers.adoc#block-join-query-parsers,Block Join 
Query Parsers>> can search these relationships,
+ and the 
`<<transforming-result-documents.adoc#child-childdoctransformerfactory,[child]>>`
 Document Transformer can attach child documents to the result documents.
+In terms of performance, indexing the relationships between documents usually 
yields much faster queries than an equivalent "query time join",
+ since the relationships are already stored in the index and do not need to be 
computed.
+However, nested documents are less flexible than query time joins as it 
imposes rules that some applications may not be able to accept.
+
+.Note
+[NOTE]
+====
+A big limitation is that the whole block of parent-children documents must be 
updated or deleted together, not separately.
+In other words, even if a single child document or the parent document is 
changed, the whole block of parent-child documents must be indexed together.
+_Solr does not enforce this rule_; if it's violated, you may get sporadic 
query failures or incorrect results.
+====
+
+Nested documents may be indexed via either the XML or JSON data syntax, and is 
also supported by <<using-solrj.adoc#using-solrj,SolrJ>> with javabin.
+
+=== Schema Notes
+
+ * The schema must include indexed field `\_root_`. The value of that field is 
populated automatically and is the same for all documents in the block, 
regardless of the inheritance depth. The id of the top document in every nested 
hierarchy is populated in this field.
 
 Review comment:
   Lets actually show a schema excerpt with all three so someone could 
copy-paste?  You could do one excerpt with all 3 or put a one-liner for each 
associated bullet here as you wish.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to