Skip to content

Commit 3a1d87c

Browse files
author
JessicaWon
committed
00_Intro is finished
1 parent c5c1f89 commit 3a1d87c

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

060_Distributed_Search/00_Intro.asciidoc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,22 @@ But finding all matching documents is only half the story. Results from
3232
multiple shards must be combined into a single sorted list before the `search`
3333
API can return a ``page'' of results. For this reason, search is executed in a
3434
two-phase process called _query then fetch_.
35+
[[分布式检索]]
36+
== 分布式检索执行
37+
38+
在开始之前,我们先来讨论有关在分布式环境中检索是如何进行的。((("distributed search execution")))比我们之前在<<distributed-docs>>中讨论过的基础的_create-read-update-delete_ (CRUD)请求的((("CRUD (create-read-update-delete) operations")))较为简单。
39+
40+
.内容提示
41+
****
42+
43+
你有兴趣的话可以读一读这章,并不需要为了使用Elasticsearch而理解和记住所有的细节。
44+
45+
这章的阅读目的只为在脑海中形成服务运行的梗概以及了解信息的存放位置以便不时之需,但是不要被细节搞的云里雾里。
46+
47+
****
48+
49+
CRUD的操作处理一个单个的文档,此文档中有一个`_index`, `_type`和<<routing-value,`routing` values>>之间的特殊连接,其中<<routing-value,`routing` values>>的缺省值为`_id`。这意味着我们知道在集群中哪个分片存有此文档。
50+
51+
检索需要一个更为精细的模型因为我们不知道哪条文档会被命中:这些文档可能分布在集群的任何分片上。一条检索的请求需要参考我们感兴趣的所有索引中的每个分片复本,这样来确认索引中是否有任何匹配的文档。
52+
53+
定位所有的匹配文档仅仅是开始,不同分片的结果在`search`的API返回``page''结果前必须融合到一个单个的已分类列表中。正因为如此,检索执行通常两步走,先是_query,然后是fetch_。

060_Distributed_Search/05_Query_phase.asciidoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@ the search locally and ((("priority queue")))builds a _priority queue_ of matchi
66

77
.Priority Queue
88
****
9+
== 搜索语句
10+
在最初阶段_query phase_时,((("distributed search execution", "query phase")))((("query phase of distributed search")))搜索是广播查询索引中的每一个分片复本,不管是主本还是副本。每个分片执行搜索本地,同时((("priority queue")))创建文档命中后的_priority queue_。
11+
912
1013
A _priority queue_ is just a sorted list that holds the _top-n_ matching
1114
documents. The size of the priority queue depends on the pagination
1215
parameters `from` and `size`. For example, the following search request
1316
would require a priority queue big enough to hold 100 documents:
1417
18+
一个_priority queue_仅仅是一个执行过滤后列表
1519
[source,js]
1620
--------------------------------------------------
1721
GET /_search

0 commit comments

Comments
 (0)