You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 21, 2021. It is now read-only.
In fact, this is the same format that is used by the ((("Sense", "curl requests in")))Sense console that we
131
+
In fact, this is the same format that is used by the ((("Marvel", "Sense console")))((("Sense console (Marvel plugin)", "curl requests in")))Sense console that we
132
132
installed with <<marvel,Marvel>>. If in the online version of this book, you can open and run this code example in
Copy file name to clipboardexpand all lines: 010_Intro/30_Tutorial_Search.asciidoc
+4-4
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ business requirements for this application. The first requirement is the
5
5
ability to retrieve individual employee data.
6
6
7
7
This is easy in Elasticsearch. We simply execute((("HTTP requests", "retrieving a document with GET"))) an HTTP +GET+ request and
8
-
specify the _address_ of the document--the index, type, and ID.((("id", "speccifying in a request")))((("indexes", "specifying index in a request")))((("types", "specifying type in a request"))) Using
8
+
specify the _address_ of the document--the index, type, and ID.((("id", "specifying in a request")))((("indices", "specifying index in a request")))((("types", "specifying type in a request"))) Using
9
9
those three pieces of information, we can return the original JSON document:
10
10
11
11
[source,js]
@@ -15,7 +15,7 @@ GET /megacorp/employee/1
15
15
// SENSE: 010_Intro/30_Get.json
16
16
17
17
And the response contains some metadata about the document, and John Smith's
18
-
original JSON document ((("source field")))as the `_source` field:
18
+
original JSON document ((("_source field", sortas="source field")))as the `_source` field:
Copy file name to clipboardexpand all lines: 020_Distributed_Cluster/15_Add_an_index.asciidoc
+3-3
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
=== Add an Index
2
2
3
3
To add data to Elasticsearch, we need an _index_—a place to store related
4
-
data.((("indexes")))((("clusters", "adding an index"))) In reality, an index is just a _logical namespace_ that points to
4
+
data.((("indices")))((("clusters", "adding an index"))) In reality, an index is just a _logical namespace_ that points to
5
5
one or more physical _shards_.
6
6
7
7
A _shard_ is a low-level _worker unit_ that holds((("shards", "defined"))) just a slice of all the
@@ -37,8 +37,8 @@ serve read requests like searching or retrieving a document.
37
37
The number of primary shards in an index is fixed at the time that an index is
38
38
created, but the number of replica shards can be changed at any time.
39
39
40
-
Let's create an index called `blogs` in our empty one-node cluster.((("indexes", "creating"))) By
41
-
default, indices are assigned five primary shards,((("primary shards", "assigned to indexes")))((("replica shards", "assigned to indexes"))) but for the purpose of this
40
+
Let's create an index called `blogs` in our empty one-node cluster.((("indices", "creating"))) By
41
+
default, indices are assigned five primary shards,((("primary shards", "assigned to indices")))((("replica shards", "assigned to indices"))) but for the purpose of this
42
42
demonstration, we'll assign just three primary shards and one replica (one replica
Copy file name to clipboardexpand all lines: 020_Distributed_Cluster/25_Scale_horizontally.asciidoc
+1-1
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
=== Scale Horizontally
2
2
3
-
What about scaling as the demand for our application grows?((("scalinghorizontally")))((("clusters", "three-node cluster")))((("primary shards", "in three-node cluster"))) If we start a
3
+
What about scaling as the demand for our application grows?((("scaling", "horizontally")))((("clusters", "three-node cluster")))((("primary shards", "in three-node cluster"))) If we start a
4
4
third node, our cluster reorganizes itself to look like
Copy file name to clipboardexpand all lines: 020_Distributed_Cluster/30_Scale_more.asciidoc
+2-2
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,13 @@
2
2
3
3
But what if we want to scale our search to more than six nodes?
4
4
5
-
The number of primary shards is fixed at the moment an((("indexes", "fixed number of primary shards")))((("primary shards", "fixed number in an index"))) index is created.
5
+
The number of primary shards is fixed at the moment an((("indices", "fixed number of primary shards")))((("primary shards", "fixed number in an index"))) index is created.
6
6
Effectively, that number defines the maximum amount of data that can be
7
7
_stored_ in the index. (The actual number depends on your data, your hardware
8
8
and your use case.) However, read requests--searches or document retrieval--can be handled by a primary _or_ a replica shard, so the more copies of
9
9
data that you have, the more search throughput you can handle.
10
10
11
-
The number of replica shards can be changed dynamically on a live cluster,
11
+
The number of ((("scaling", "increasing number of replica shards")))replica shards can be changed dynamically on a live cluster,
12
12
allowing us to scale up or down as demand requires. Let's increase the number
Copy file name to clipboardexpand all lines: 020_Distributed_Cluster/35_Coping_with_failure.asciidoc
+1-1
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
=== Coping with Failure
2
2
3
3
We've said that Elasticsearch can cope when nodes fail, so let's go
4
-
ahead and try it out. ((("shards", "horizontal scaling and safety of data")))((("failure", "coping with")))((("master node", "killing and replacing")))((("nodes", "failure of")))((("clusters", "coping with failure of nodes")))If we kill the first node, our cluster looks like
4
+
ahead and try it out. ((("shards", "horizontal scaling and safety of data")))((("failure of nodes, coping with")))((("master node", "killing and replacing")))((("nodes", "failure of")))((("clusters", "coping with failure of nodes")))If we kill the first node, our cluster looks like
Copy file name to clipboardexpand all lines: 030_Data/10_Index.asciidoc
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
[[index-doc]]
2
2
=== Indexing a Document
3
3
4
-
Documents are _indexed_—stored and made ((("documents", "indexing")))((("indexes", "indexing a document")))searchable--by using the `index`
4
+
Documents are _indexed_—stored and made ((("documents", "indexing")))((("indexing", "a document")))searchable--by using the `index`
5
5
API. But first, we need to decide where the document lives. As we just
6
6
discussed, a document's `_index`, `_type`, and `_id` uniquely identify the
7
7
document. We can either provide our own `_id` value or let the `index` API
@@ -65,7 +65,7 @@ made by another part.
65
65
==== Autogenerating IDs
66
66
67
67
If our data doesn't have a natural ID, we can let Elasticsearch autogenerate
68
-
one for us. ((("id", "autogenerating")))The structure of the request changes: instead of using ((("HTP methods", "POST")))the `PUT`
68
+
one for us. ((("id", "autogenerating")))The structure of the request changes: instead of using ((("HTTP methods", "POST")))((("POST method")))the `PUT`
69
69
verb (``store this document at this URL''), we use the `POST` verb (``store this document _under_ this URL'').
70
70
71
71
The URL now contains just the `_index` and the `_type`:
Copy file name to clipboardexpand all lines: 030_Data/25_Update.asciidoc
+1-1
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
=== Updating a Whole Document
3
3
4
4
Documents in Elasticsearch are _immutable_; we cannot change them.((("documents", "updating whole document")))((("updating documents", "whole document"))) Instead, if
5
-
we need to update an existing document, we _reindex_ or replace it, which we
5
+
we need to update an existing document, we _reindex_ or replace it,((("reindexing")))((("indexing", seealso="reindexing"))) which we
6
6
can do using the same `index` API that we have already discussed in
Copy file name to clipboardexpand all lines: 040_Distributed_CRUD/05_Routing.asciidoc
+1-1
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
[[routing-value]]
2
2
=== Routing a Document to a Shard
3
3
4
-
When you index a document, it is stored on a single primary shard.((("shards", "routing a document to")))((("routing a document to a shard"))) How does
4
+
When you index a document, it is stored on a single primary shard.((("shards", "routing a document to")))((("documents", "routing a document to a shard")))((("routing a document to a shard"))) How does
5
5
Elasticsearch know which shard a document belongs to? When we create a new
6
6
document, how does it know whether it should store that document on shard 1 or
0 commit comments