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号从家里回来以后决定自 ...
随机推荐
- android weight(权重)的详细分析
首先要明确权重分配的是那些空间? 权重是依照比例分配屏幕的剩余空间 对这句话不理解的能够看下图 假如我们希望剩余的空间平分给空间1 和空间2 , 我们分别在2个控件的设置android:layout_ ...
- Codeforces Round #276 (Div. 1)D.Kindergarten DP贪心
D. Kindergarten In a kindergarten, the children are being divided into groups. The teacher put t ...
- elasticsearch _field_stats 源码分析
_field_stats 实现的功能:https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-field-stats.ht ...
- H264的RTP负载打包的数据包格式,分组,分片
H264的RTP负载打包的数据包格式,分组,分片 1. RTP数据包格式 RTP报文头格式(见RFC3550 Page12): 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 ...
- android sdk 更新失败问题解决办法
网上几乎都是这么说的 1.设置tools下的options,然后点击菜单packages下的reload 2.然后就会出现列表在点install进行安装 但是在更新时莫名其妙的也会出现错误 解决类似这 ...
- ride关键字
定义变量:set variable 打印 :log 列表:create list 字符转数字型:evaluate 随机数:evaluate random.randint 日志截图:先导入screens ...
- 二进制部署Kubernetes-v1.14.1集群
一.部署Kubernetes集群 1.1 Kubernetes介绍 Kubernetes(K8S)是Google开源的容器集群管理系统,K8S在Docker容器技术的基础之上,大大地提高了容器化部署应 ...
- ACM_魔仙岛探险(深搜)
魔仙岛探险 Time Limit: 2000/1000ms (Java/Others) Problem Description: 小敏通过秘密方法得到一张不完整的魔仙岛航拍地图.魔仙岛由一个主岛和一些 ...
- Vue初级
来学习vue.js的宝宝们应该都了解了什么是vue并且是有兴趣去学的,我也是自己学习vue,欢迎大家一起讨论. 现在,我么先自己尝试用vue来写个hello world吧. 一.创建一个 .html ...
- Django学习案例一(blog):六. 开发博客内容页面
目标:某条博客具体内容的展示,可返回博客主页面,可进行评论. 1. 编辑路由 一篇博客,要将其找出来,就需要有一个唯一的标识.Django 的模型中默认有一个唯一的且未自增长的主键,即 id 字段.我 ...