4
点赞
收藏
分享

微信扫一扫

注意力机制和Transformer

非衣所思 2023-06-20 阅读 67
  • 你们用的什么注册中心?
  • 了解zk的选举机制吗?
  • es查询的原理or流程?我答Lucene与倒排索引。Q:上层呢?参考答案1
  1. Query phase:
    When a search request is sent to a node, that node becomes the coordinating node. It is the job of this node to broadcast the search request to all involved shards, and to gather their responses into a globally sorted result set that it can return to the client:
    … 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.
    Each shard returns the doc IDs and sort values of all the docs in its priority queue to the coordinating node, which merges these values into its own priority queue to produce a globally sorted list of results.
  2. Fetch Phase:
    The coordinating node identifies which documents need to be fetched and issues a multi GET request to the relevant shards.
    Once all documents have been fetched, the coordinating node returns the results to the client.

有个相关扩展问题:为什么es增加副本的个数可以增加搜索的吞吐量?我原来觉得多副本只能增加系统可用性,想不通为什么也能增加搜索吞吐量。参考答案:
一个请求时只会选取一个副本分片去做查询,但是有多个请求时,多个请求会分发到不同的副本上去,从而减轻那分片的压力。2


  1. https://www.elastic.co/guide/en/elasticsearch/guide/current/_query_phase.html (注意对应的中文版文档翻译得有歧义,让人误以为协调节点将查询请求转发到索引的每个主分片和副本分片) ↩︎ ↩︎

  2. es多副本为什么能提高吞吐量 ↩︎

举报

相关推荐

4 条评论

https://ibb.co/KR8Z32v https://ibb.co/Kx6MXH0S https://ibb.co/YC8gppX https://ibb.co/BVv4VpRB https://ibb.co/My2QRkx3 https://ibb.co/bMRQ9FvR https://ibb.co/zHVXgfDD https://ibb.co/tMPqcMSm

https://ibb.co/6Rdnt9PB https://ibb.co/1fPydcWC https://ibb.co/bgqxC7sz https://ibb.co/1JGg4G91 https://ibb.co/pj9gtp72 https://ibb.co/0pHGmBX5 https://ibb.co/9kPkM8hB https://ibb.co/9kqN24yd

https://ibb.co/JWHLxNqy https://ibb.co/6Rdnt9PB https://ibb.co/1fPydcWC https://ibb.co/bgqxC7sz https://ibb.co/cSKZb6K3 https://ibb.co/5htHRBCM https://ibb.co/svcYkW37 https://ibb.co/JWHLxNqy

https://ibb.co/GQvttGx7 https://ibb.co/rGrZqZLD https://ibb.co/XZMg3PsT https://ibb.co/fVtmqJzq https://ibb.co/yB5kgPZZ https://ibb.co/6p3NJbj https://ibb.co/MycFby8H https://ibb.co/6JRFhJjL