zoukankan      html  css  js  c++  java
  • 57.query phase

    主要知识点:

    • query phase步骤
    • query phase如何提升性能

       

    一、query phase步骤

    一次query phase一般包括以下三个步骤

       

    The query phase consists of the following three steps:

    1. The client sends a search request to Node 3, which creates an empty priority queue of size from + size.
    2. 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.
    3. 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操作fromsize为准,默认为10

    2coordinate node将请求转发到所有shard,每个shard本地搜索,并构建一个本地的priority queue

    3、各个shard将自己的priority queue返回给coordinate nodecoordinate node对这些priority queue 进行合并,并构建一个全局的priority queue,然后在这个priority queue得到搜索页的结果。

       

    二、replica shard如何提升搜索吞吐量

       

    一次请求要路由所有shard的一个replicaprimary上去,如果每个shard都有多个replica,那么同时并发过来的搜索请求可以同时打到其他的replica上去。(也就是说一请求对于一个primary shard及其他对应的所有replica shard 只会有一个shard去处理这一次请求)

       

    三、延伸阅读

    query phase

       

       

  • 相关阅读:
    js 实现继承的6种方式(逐渐优化)
    http2.0 特性
    http 206请求
    http put post请求区别
    stopPropagation 和stopImmediatePropagation区别
    JavaScript事件流
    BFC特性 形成BFC
    元素高度、宽度获取 style currentStyle getComputedStyle getBoundingClientRect
    三栏布局解决方案
    jquery vue 框架区别
  • 原文地址:https://www.cnblogs.com/liuqianli/p/8473235.html
Copyright © 2011-2022 走看看