|
1 | 1 | [[distributed-search]]
|
2 |
| -== Distributed Search Execution |
| 2 | +== 执行分布式检索 |
3 | 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>>. |
| 4 | +在继续之前,我们将绕道讨论一下在分布式环境中搜索是怎么执行的。 |
| 5 | +((("distributed search execution"))) 这比我们在 <<distributed-docs>> 章节讨论的基本的 _增-删-改-查_ (CRUD)((("CRUD (create-read-update-delete) operations")))请求要复杂一些。 |
8 | 6 |
|
9 |
| -.Content Warning |
| 7 | + |
| 8 | +.内容提示 |
10 | 9 | ****
|
11 | 10 |
|
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. |
| 11 | +你可以根据兴趣阅读本章内容。你并不需要为了使用 Elasticsearch 而理解和记住所有的细节。 |
14 | 12 |
|
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. |
| 13 | +这章的阅读目的只为初步了解下工作原理,以便将来需要时可以及时找到这些知识, |
| 14 | +但是不要被细节所困扰。 |
18 | 15 |
|
19 | 16 | ****
|
20 | 17 |
|
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. |
| 18 | +一个 CRUD 操作只对单个文档进行处理,文档的唯一性由 `_index`, `_type`, |
| 19 | +和 <<routing-value,`routing` values>> (通常默认是该文档的 `_id` )的组合来确定。 |
| 20 | +这表示我们确切的知道集群中哪个分片含有此文档。 |
| 21 | + |
| 22 | + |
| 23 | +搜索需要一种更加复杂的执行模型因为我们不知道查询会命中哪些文档: 这些文档有可能在集群的任何分片上。 |
| 24 | +一个搜索请求必须询问我们关注的索引(index or indices)的所有分片的某个副本来确定它们是否含有任何匹配的文档。 |
25 | 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 | 26 |
|
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_. |
| 27 | +但是找到所有的匹配文档仅仅完成事情的一半。 |
| 28 | +在 `search` 接口返回一个 ``page`` 结果之前,多分片中的结果必须组合成单个排序列表。 |
| 29 | +为此,搜索被执行成一个两阶段过程,我们称之为 _query then fetch_ 。 |
0 commit comments