diff --git a/06_Modeling_your_data.asciidoc b/06_Modeling_your_data.asciidoc index 23fc6f516..30c9a4109 100644 --- a/06_Modeling_your_data.asciidoc +++ b/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 <> -we will discuss the pros and cons of the available approaches. +``normalize your data'' -- does not apply to Elasticsearch. In <>, +<>, and <> we will discuss the pros and cons of +the available approaches. Then in <> we will talk about the features that Elasticsearch offers which enable you to scale out quickly and flexibly. Scale is not one-size- diff --git a/400_Relationships.asciidoc b/400_Relationships.asciidoc index 81fdf6005..56d18d31e 100644 --- a/400_Relationships.asciidoc +++ b/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 - -//////////// diff --git a/400_Relationships/10_Intro.asciidoc b/400_Relationships/10_Intro.asciidoc index 8f10a5a5f..ee0f7f651 100644 --- a/400_Relationships/10_Intro.asciidoc +++ b/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: * <>. * <>. diff --git a/402_Nested.asciidoc b/402_Nested.asciidoc new file mode 100644 index 000000000..9171fdd4e --- /dev/null +++ b/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[] + diff --git a/400_Relationships/30_Nested_objects.asciidoc b/402_Nested/30_Nested_objects.asciidoc similarity index 99% rename from 400_Relationships/30_Nested_objects.asciidoc rename to 402_Nested/30_Nested_objects.asciidoc index af1892e2c..cbc750585 100644 --- a/400_Relationships/30_Nested_objects.asciidoc +++ b/402_Nested/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 diff --git a/400_Relationships/31_Nested_mapping.asciidoc b/402_Nested/31_Nested_mapping.asciidoc similarity index 100% rename from 400_Relationships/31_Nested_mapping.asciidoc rename to 402_Nested/31_Nested_mapping.asciidoc diff --git a/400_Relationships/32_Nested_query.asciidoc b/402_Nested/32_Nested_query.asciidoc similarity index 100% rename from 400_Relationships/32_Nested_query.asciidoc rename to 402_Nested/32_Nested_query.asciidoc diff --git a/400_Relationships/33_Nested_sorting.asciidoc b/402_Nested/33_Nested_sorting.asciidoc similarity index 100% rename from 400_Relationships/33_Nested_sorting.asciidoc rename to 402_Nested/33_Nested_sorting.asciidoc diff --git a/400_Relationships/35_Nested_aggs.asciidoc b/402_Nested/35_Nested_aggs.asciidoc similarity index 100% rename from 400_Relationships/35_Nested_aggs.asciidoc rename to 402_Nested/35_Nested_aggs.asciidoc diff --git a/404_Parent_Child.asciidoc b/404_Parent_Child.asciidoc new file mode 100644 index 000000000..048fbc565 --- /dev/null +++ b/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[] + diff --git a/400_Relationships/40_Parent_child.asciidoc b/404_Parent_Child/40_Parent_child.asciidoc similarity index 97% rename from 400_Relationships/40_Parent_child.asciidoc rename to 404_Parent_Child/40_Parent_child.asciidoc index d8da97233..ecbf6f5ca 100644 --- a/400_Relationships/40_Parent_child.asciidoc +++ b/404_Parent_Child/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 <> -- 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 diff --git a/400_Relationships/45_Indexing_parent_child.asciidoc b/404_Parent_Child/45_Indexing_parent_child.asciidoc similarity index 100% rename from 400_Relationships/45_Indexing_parent_child.asciidoc rename to 404_Parent_Child/45_Indexing_parent_child.asciidoc diff --git a/400_Relationships/50_Has_child.asciidoc b/404_Parent_Child/50_Has_child.asciidoc similarity index 100% rename from 400_Relationships/50_Has_child.asciidoc rename to 404_Parent_Child/50_Has_child.asciidoc diff --git a/400_Relationships/55_Has_parent.asciidoc b/404_Parent_Child/55_Has_parent.asciidoc similarity index 100% rename from 400_Relationships/55_Has_parent.asciidoc rename to 404_Parent_Child/55_Has_parent.asciidoc diff --git a/400_Relationships/60_Parent_child_aggs.asciidoc b/404_Parent_Child/60_Parent_child_aggs.asciidoc similarity index 100% rename from 400_Relationships/60_Parent_child_aggs.asciidoc rename to 404_Parent_Child/60_Parent_child_aggs.asciidoc diff --git a/400_Relationships/65_Grandparents.asciidoc b/404_Parent_Child/65_Grandparents.asciidoc similarity index 100% rename from 400_Relationships/65_Grandparents.asciidoc rename to 404_Parent_Child/65_Grandparents.asciidoc diff --git a/400_Relationships/70_Practical_considerations.asciidoc b/404_Parent_Child/70_Practical_considerations.asciidoc similarity index 100% rename from 400_Relationships/70_Practical_considerations.asciidoc rename to 404_Parent_Child/70_Practical_considerations.asciidoc diff --git a/book.asciidoc b/book.asciidoc index 30194b440..6b363c598 100644 --- a/book.asciidoc +++ b/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