Skip to content
This repository was archived by the owner on Sep 21, 2021. It is now read-only.

Commit 03ff4b8

Browse files
Refactored nested and parent-child into their own chapters
1 parent 8f1ed17 commit 03ff4b8

18 files changed

+35
-43
lines changed

06_Modeling_your_data.asciidoc

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ understand how it works and how to make it work for your needs.
1515

1616
Handling relationships between entities is not as obvious as it is with a
1717
dedicated relational store. The golden rule of a relational database --
18-
``normalize your data'' -- does not apply to Elasticsearch. In <<relations>>
19-
we will discuss the pros and cons of the available approaches.
18+
``normalize your data'' -- does not apply to Elasticsearch. In <<relations>>,
19+
<<nested-objects>>, and <<parent-child>> we will discuss the pros and cons of
20+
the available approaches.
2021

2122
Then in <<scale>> we will talk about the features that Elasticsearch offers
2223
which enable you to scale out quickly and flexibly. Scale is not one-size-

400_Relationships.asciidoc

-37
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,3 @@ include::400_Relationships/25_Concurrency.asciidoc[]
1010

1111
include::400_Relationships/26_Concurrency_solutions.asciidoc[]
1212

13-
include::400_Relationships/30_Nested_objects.asciidoc[]
14-
15-
include::400_Relationships/31_Nested_mapping.asciidoc[]
16-
17-
include::400_Relationships/32_Nested_query.asciidoc[]
18-
19-
include::400_Relationships/33_Nested_sorting.asciidoc[]
20-
21-
include::400_Relationships/35_Nested_aggs.asciidoc[]
22-
23-
include::400_Relationships/40_Parent_child.asciidoc[]
24-
25-
include::400_Relationships/45_Indexing_parent_child.asciidoc[]
26-
27-
include::400_Relationships/50_Has_child.asciidoc[]
28-
29-
include::400_Relationships/55_Has_parent.asciidoc[]
30-
31-
include::400_Relationships/60_Parent_child_aggs.asciidoc[]
32-
33-
include::400_Relationships/65_Grandparents.asciidoc[]
34-
35-
include::400_Relationships/70_Practical_considerations.asciidoc[]
36-
37-
38-
////////////
39-
40-
41-
=== Parent-child relationship
42-
* Mapping
43-
* Indexing, retrieving and deleting documents
44-
* Searching
45-
** has_child query / filter
46-
** has_parent query / filter
47-
** top_children query
48-
49-
////////////

400_Relationships/10_Intro.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ This FlatWorld has its advantages:
5050

5151
But relationships matter. Somehow, we need to bridge the gap between
5252
FlatWorld and the real world. There are four common techniques used to manage
53-
relational data in Elasticsearch, which we will be discussing in this chapter:
53+
relational data in Elasticsearch, which we will be discussing:
5454

5555
* <<application-joins,Application-side joins>>.
5656
* <<denormalization,Data denormalization>>.

402_Nested.asciidoc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
include::402_Nested/30_Nested_objects.asciidoc[]
2+
3+
include::402_Nested/31_Nested_mapping.asciidoc[]
4+
5+
include::402_Nested/32_Nested_query.asciidoc[]
6+
7+
include::402_Nested/33_Nested_sorting.asciidoc[]
8+
9+
include::402_Nested/35_Nested_aggs.asciidoc[]
10+

400_Relationships/30_Nested_objects.asciidoc 402_Nested/30_Nested_objects.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[nested-objects]]
2-
=== Nested objects
2+
== Nested objects
33

44
Given the fact that creating, deleting and updating a single document in
55
Elasticsearch is atomic, it makes sense to store closely related entities
File renamed without changes.
File renamed without changes.

404_Parent_Child.asciidoc

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
include::404_Parent_Child/40_Parent_child.asciidoc[]
2+
3+
include::404_Parent_Child/45_Indexing_parent_child.asciidoc[]
4+
5+
include::404_Parent_Child/50_Has_child.asciidoc[]
6+
7+
include::404_Parent_Child/55_Has_parent.asciidoc[]
8+
9+
include::404_Parent_Child/60_Parent_child_aggs.asciidoc[]
10+
11+
include::404_Parent_Child/65_Grandparents.asciidoc[]
12+
13+
include::404_Parent_Child/70_Practical_considerations.asciidoc[]
14+

400_Relationships/40_Parent_child.asciidoc 404_Parent_Child/40_Parent_child.asciidoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[parent-child]]
2-
=== Parent-child relationship
2+
== Parent-child relationship
33

44
The _parent-child_ relationship is similar in nature to the
55
<<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
2525
document and all of its children *must* live on the same shard.
2626

2727
[[parent-child-mapping]]
28-
==== Parent-child mapping
28+
=== Parent-child mapping
2929

3030
All that is needed in order to establish the parent-child relationship, is to
3131
specify which document type should be the parent of a child type. This must
File renamed without changes.

book.asciidoc

+4
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ include::06_Modeling_your_data.asciidoc[]
9797

9898
include::400_Relationships.asciidoc[]
9999

100+
include::402_Nested.asciidoc[]
101+
102+
include::404_Parent_Child.asciidoc[]
103+
100104
include::410_Scaling.asciidoc[]
101105

102106
// Part 7

0 commit comments

Comments
 (0)