浏览代码

Refactored nested and parent-child into their own chapters

Clinton Gormley 11 年之前
父节点
当前提交
03ff4b884c

+ 3 - 2
06_Modeling_your_data.asciidoc

@@ -15,8 +15,9 @@ understand how it works and how to make it work for your needs.
 
 Handling relationships between entities is not as obvious as it is with a
 dedicated relational store.  The golden rule of a relational database --
-``normalize your data'' -- does not apply to Elasticsearch. In <<relations>>
-we will discuss the pros and cons of the available approaches.
+``normalize your data'' -- does not apply to Elasticsearch. In <<relations>>,
+<<nested-objects>>, and <<parent-child>> we will discuss the pros and cons of
+the available approaches.
 
 Then in <<scale>> we will talk about the features that Elasticsearch offers
 which enable you to scale out quickly and flexibly.  Scale is not  one-size-

+ 0 - 37
400_Relationships.asciidoc

@@ -10,40 +10,3 @@ include::400_Relationships/25_Concurrency.asciidoc[]
 
 include::400_Relationships/26_Concurrency_solutions.asciidoc[]
 
-include::400_Relationships/30_Nested_objects.asciidoc[]
-
-include::400_Relationships/31_Nested_mapping.asciidoc[]
-
-include::400_Relationships/32_Nested_query.asciidoc[]
-
-include::400_Relationships/33_Nested_sorting.asciidoc[]
-
-include::400_Relationships/35_Nested_aggs.asciidoc[]
-
-include::400_Relationships/40_Parent_child.asciidoc[]
-
-include::400_Relationships/45_Indexing_parent_child.asciidoc[]
-
-include::400_Relationships/50_Has_child.asciidoc[]
-
-include::400_Relationships/55_Has_parent.asciidoc[]
-
-include::400_Relationships/60_Parent_child_aggs.asciidoc[]
-
-include::400_Relationships/65_Grandparents.asciidoc[]
-
-include::400_Relationships/70_Practical_considerations.asciidoc[]
-
-
-////////////
-
-
-=== Parent-child relationship
-* Mapping
-* Indexing, retrieving and deleting documents
-* Searching
-** has_child query / filter
-** has_parent query / filter
-** top_children query
-
-////////////

+ 1 - 1
400_Relationships/10_Intro.asciidoc

@@ -50,7 +50,7 @@ This FlatWorld has its advantages:
 
 But relationships matter.  Somehow, we need to bridge the gap between
 FlatWorld and the real world. There are four common techniques used to manage
-relational data in Elasticsearch, which we will be discussing in this chapter:
+relational data in Elasticsearch, which we will be discussing:
 
 * <<application-joins,Application-side joins>>.
 * <<denormalization,Data denormalization>>.

+ 10 - 0
402_Nested.asciidoc

@@ -0,0 +1,10 @@
+include::402_Nested/30_Nested_objects.asciidoc[]
+
+include::402_Nested/31_Nested_mapping.asciidoc[]
+
+include::402_Nested/32_Nested_query.asciidoc[]
+
+include::402_Nested/33_Nested_sorting.asciidoc[]
+
+include::402_Nested/35_Nested_aggs.asciidoc[]
+

+ 1 - 1
400_Relationships/30_Nested_objects.asciidoc

@@ -1,5 +1,5 @@
 [[nested-objects]]
-=== Nested objects
+== Nested objects
 
 Given the fact that creating, deleting and updating a single document in
 Elasticsearch is atomic, it makes sense to store closely related entities

400_Relationships/31_Nested_mapping.asciidoc → 402_Nested/31_Nested_mapping.asciidoc


400_Relationships/32_Nested_query.asciidoc → 402_Nested/32_Nested_query.asciidoc


400_Relationships/33_Nested_sorting.asciidoc → 402_Nested/33_Nested_sorting.asciidoc


400_Relationships/35_Nested_aggs.asciidoc → 402_Nested/35_Nested_aggs.asciidoc


+ 14 - 0
404_Parent_Child.asciidoc

@@ -0,0 +1,14 @@
+include::404_Parent_Child/40_Parent_child.asciidoc[]
+
+include::404_Parent_Child/45_Indexing_parent_child.asciidoc[]
+
+include::404_Parent_Child/50_Has_child.asciidoc[]
+
+include::404_Parent_Child/55_Has_parent.asciidoc[]
+
+include::404_Parent_Child/60_Parent_child_aggs.asciidoc[]
+
+include::404_Parent_Child/65_Grandparents.asciidoc[]
+
+include::404_Parent_Child/70_Practical_considerations.asciidoc[]
+

+ 2 - 2
400_Relationships/40_Parent_child.asciidoc

@@ -1,5 +1,5 @@
 [[parent-child]]
-=== Parent-child relationship
+== Parent-child relationship
 
 The _parent-child_ relationship is similar in nature to the
 <<nested-objects,nested model>> -- both allow you to associate one entity
@@ -25,7 +25,7 @@ it does place a limitation on the parent-child relationship: the parent
 document and all of its children *must* live on the same shard.
 
 [[parent-child-mapping]]
-==== Parent-child mapping
+=== Parent-child mapping
 
 All that is needed in order to establish the parent-child relationship, is to
 specify which document type should be the parent of a child type.  This must

400_Relationships/45_Indexing_parent_child.asciidoc → 404_Parent_Child/45_Indexing_parent_child.asciidoc


400_Relationships/50_Has_child.asciidoc → 404_Parent_Child/50_Has_child.asciidoc


400_Relationships/55_Has_parent.asciidoc → 404_Parent_Child/55_Has_parent.asciidoc


400_Relationships/60_Parent_child_aggs.asciidoc → 404_Parent_Child/60_Parent_child_aggs.asciidoc


400_Relationships/65_Grandparents.asciidoc → 404_Parent_Child/65_Grandparents.asciidoc


400_Relationships/70_Practical_considerations.asciidoc → 404_Parent_Child/70_Practical_considerations.asciidoc


+ 4 - 0
book.asciidoc

@@ -97,6 +97,10 @@ include::06_Modeling_your_data.asciidoc[]
 
 include::400_Relationships.asciidoc[]
 
+include::402_Nested.asciidoc[]
+
+include::404_Parent_Child.asciidoc[]
+
 include::410_Scaling.asciidoc[]
 
 // Part 7