Skip to content

Commit

Permalink
Refactored nested and parent-child into their own chapters
Browse files Browse the repository at this point in the history
  • Loading branch information
clintongormley committed Aug 18, 2014
1 parent 8f1ed17 commit 03ff4b8
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 43 deletions.
5 changes: 3 additions & 2 deletions 06_Modeling_your_data.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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-
Expand Down
37 changes: 0 additions & 37 deletions 400_Relationships.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

////////////
2 changes: 1 addition & 1 deletion 400_Relationships/10_Intro.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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>>.
Expand Down
10 changes: 10 additions & 0 deletions 402_Nested.asciidoc
Original file line number Diff line number Diff line change
@@ -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[]

Original file line number Diff line number Diff line change
@@ -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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions 404_Parent_Child.asciidoc
Original file line number Diff line number Diff line change
@@ -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[]

Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions book.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 03ff4b8

Please sign in to comment.