57.query phase
主要知识点:
- query phase步骤
- query phase如何提升性能
一、query phase步骤
一次query phase一般包括以下三个步骤

The query phase consists of the following three steps:
- The client sends a search request to Node 3, which creates an empty priority queue of size from + size.
- Node 3 forwards the search request to a primary or replica copy of every shard in the index. Each shard executes the query locally and adds the results into a local sorted priority queue of size from + size.
- Each shard returns the doc IDs and sort values of all the docs in its priority queue to the coordinating node, Node 3, which merges these values into its own priority queue to produce a globally sorted list of results.
1、搜索请求发送到某一个coordinate node(node3),构构建一个priority queue,长度以paging操作from和size为准,默认为10
2、coordinate node将请求转发到所有shard,每个shard本地搜索,并构建一个本地的priority queue
3、各个shard将自己的priority queue返回给coordinate node,coordinate node对这些priority queue 进行合并,并构建一个全局的priority queue,然后在这个priority queue得到搜索页的结果。
二、replica shard如何提升搜索吞吐量
一次请求要路由所有shard的一个replica或primary上去,如果每个shard都有多个replica,那么同时并发过来的搜索请求可以同时打到其他的replica上去。(也就是说一请求对于一个primary shard及其他对应的所有replica shard 只会有一个shard去处理这一次请求)
三、延伸阅读
57.query phase的更多相关文章
- Elasticsearch的query phase和fetch phase
对于一次query查询到数据返回到客户端,经历了两个过程 query phase和fetch phase的过程 query phase 查询阶段 fetch phase 获取阶段. 1 qu ...
- ElasticSearch7.3学习(二十五)----Doc value、query phase、fetch phase解析
1.Doc value 搜索的时候,要依靠倒排索引: 排序的时候,需要依靠正排索引,看到每个document的每个field,然后进行排序. 所谓的正排索引,其实就是doc values. 在建立索引 ...
- ES--06
第51.初识搜索引擎_上机动手实战多搜索条件组合查询 课程大纲 GET /website/article/_search{ "query": { "bool": ...
- elasticsearch 基础 语法总结
1. es 使用 restful 风格的 api 备注: es 的 api 格式 基本是这个样 请求方式 /索引名/文档名/id?参数 ,但是 还有 很多不是这样的 请求,比如 ...
- Elasticsearch顶尖高手系列课程推荐
Elasticsearch,是目前行业中非常热门的一个技术.Elasticsearch是一种分布式的海量数据搜索与分析的技术,可以用于电商网站.门户网站.企业IT系统等各种场景下的搜索引擎,也可以用于 ...
- Elasticsearch之深入理解
@ 目录 ES应用场景 ES应用场景举例 应用场景思考 ES和其他数据库对比 ES架构 Gateway Lucene 数据处理 发现机制与脚本 Transport REST full API ES中集 ...
- ElasticSearch 基本介绍和读写搜索过程
cluster 代表一个集群,集群中有多个节点,其中有一个为主节点,这个主节点是可以通过选举产生的,主从节点是对于集群内部来说的.es的一个概念就是去中心化,字面上理解就是无中心节点,这是对于集群外部 ...
- ZOJ 刷题记录 (。・ω・)ノ゙(Progress:31/50)
[热烈庆祝ZOJ回归] P1002:简单的DFS #include <cstdio> #include <cstring> #include <algorithm> ...
- PHP之MVC微型框架简单搭建
好长时间没有写博客了,这段时间过得紧张的不行,以致于都没有抽出时间来好好的总结一下自己这段时间的生活和学习. 其实今天不想写什么技术博客,就想简单总结一下这段时间的生活.10月8号从家里回来以后决定自 ...
随机推荐
- Axure RP一个专业的高速原型设计工具
Axure RP是一个专业的高速原型设计工具.Axure(发音:Ack-sure),代表美国Axure公司.RP则是Rapid Prototyping(高速原型)的缩写. Axure简要介绍 Axur ...
- hadoop常见操作命令
1.查看指定文件夹下内容 hadoop dfs –ls [文件文件夹] eg: hadoop dfs –ls /user/wangkai.pt 2.打开某个已存在文件 hadoop dfs –cat ...
- $().attr()的使用方法 && $().html()与$().text()的差别
<1>$().attr()的使用方法 </pre><pre class="html" name="code"><htm ...
- mysql-5.5 for linux源码安装
mysql-5.5 for linux源码安装 1.使用Yum安装依赖软件包 # yum install -y gcc gcc-c++ gcc-g77 autoconf automake bison ...
- jquery-layer弹出框
样式1: 代码: 前台jsp: $("#add_table").bind("click",function(){ layer.open({ type: 2, t ...
- hdu 4704(费马小定理+快速幂取模)
Sum Time Limit: 2000/ ...
- TCP打开文件传输(服务器端并发code)
#include <stdio.h>#include <stdlib.h>#include <arpa/inet.h>#include <sys/types. ...
- 网络简要<入门篇>对应配置代码
交换机的配置 (1)交换机的模式: switch> 用户模式,可以查看设备的部分内容 SW-3ceng>enable SW-3ceng# 进入特权模式,可以查看更多 ...
- CSS中的五大字体家族(cursive 手写字体族更吸引我)
这是CSS中的五大字体家族. serifserif 中文翻译为“衬线字体族”.serif 具有末端加粗.扩张或尖细末端,或以实际的衬线结尾的一类字体.可以看出 serif 总是在文字末端做文章,这样做 ...
- buf.readInt16LE函数详解
offset {Number} 0 noAssert {Boolean} 默认:false 返回:{Number} 从该 Buffer 指定的带有特定尾数格式(readInt16BE() 返回一个较大 ...