File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ [[distributed-search]]
2
+ == Distributed Search Execution
3
+
4
+ Before moving on, we are going to take a detour and talk about how search is
5
+ executed in a distributed environment.((("distributed search execution"))) It is a bit more complicated than the
6
+ basic _create-read-update-delete_ (CRUD) requests((("CRUD (create-read-update-delete) operations"))) that we discussed in
7
+ <<distributed-docs>>.
8
+
9
+ .Content Warning
10
+ ****
11
+
12
+ The information presented in this chapter is for your interest. You are not required to
13
+ understand and remember all the detail in order to use Elasticsearch.
14
+
15
+ Read this chapter to gain a taste for how things work, and to know where the
16
+ information is in case you need to refer to it in the future, but don't be
17
+ overwhelmed by the detail.
18
+
19
+ ****
20
+
21
+ A CRUD operation deals with a single document that has a unique combination of
22
+ `_index`, `_type`, and <<routing-value,`routing` values>> (which defaults to the
23
+ document's `_id`). This means that we know exactly which shard in the cluster
24
+ holds that document.
25
+
26
+ Search requires a more complicated execution model because we don't know which
27
+ documents will match the query: they could be on any shard in the cluster. A
28
+ search request has to consult a copy of every shard in the index or indices
29
+ we're interested in to see if they have any matching documents.
30
+
31
+ But finding all matching documents is only half the story. Results from
32
+ multiple shards must be combined into a single sorted list before the `search`
33
+ API can return a ``page'' of results. For this reason, search is executed in a
34
+ two-phase process called _query then fetch_.
35
+
1
36
[[distributed-search]]
2
37
== 分布式检索执行
3
38
You can’t perform that action at this time.
0 commit comments