_search查询在Elasticsearch中如何工作? [英] How do _search queries work in Elasticsearch?

查看:108
本文介绍了_search查询在Elasticsearch中如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更多的问题是: Elasticsearch节点如何交互以给出特定的搜索结果,搜索请求的流程是什么?


我已经提到下面的链接可以理解,但对于我要理解的内容,它们并不太清楚。



  1. 根据上述文档,


    1. 数据节点

    2. 摄取节点是执行_search查询时执行所有处理的变量。在对数据建立索引之前需要进行一些预处理。

    那么,以上两个语句是否正确?
    因此,


    1. 在发生_search查询时,摄取节点有什么作用吗?

    2. 数据节点在索引数据时有什么作用?

    3. 其他任何节点在搜索数据时也有什么作用?

    或者,如果您可以帮助说明搜索请求的流程(哪个节点接收API调用,哪个节点过滤数据,哪个节点运行聚合等),那么这真的很有帮助


    如果相关,那么我使用的是Elastic Search 7.5

    解决方案


    1. 在发生 _search 查询时,Ingest节点有什么作用吗?
      如果它是专用的实例节点,则为否,如果它还保存数据(分片和副本),则为否。



    2. 在为数据建立索引时,数据节点是否有任何作用?
      是的,数据节点实际上持有数据(分片和副本),最终它们负责索引和搜索该数据



    3. 正在搜索数据时,其他任何节点是否有任何作用? 是的,请参考



    简而言之,摄取节点只需进行数据转换,数据节点实际上就会保存数据,并且所有角色都可以专用或共享给ES中的节点。


    以下是搜索请求中的步骤-


    1. 协调节点收到请求,它可以是专用节点,也可以是数据节点(默认)。

    2. 协调节点将请求转发到数据节点,该数据节点保留用于您的搜索请求的分片(主或副本)。

    3. 数据节点进行本地搜索并将结果发送回给

    4. 协调节点将汇总所有节点的前10个搜索结果(默认为10个)并发送回响应。


    The question is more around: "How do Elasticsearch nodes interact to give a specific search result and what is the flow of a search request?"

    I've referred to the following links to understand, but they aren't very clear, in what I am trying to understand.

    1. https://www.elastic.co/guide/en/elasticsearch/reference/master/ingest.html
    2. https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-node.html

    As per the above documentation,

    1. "Data Nodes" are the ones which perform all the processing when an _search query is invoked.
    2. "Ingest nodes" do some pre-processing before indexing the data.

    So, are these above two statements correct? Accordingly,

    1. Do Ingest nodes have any role to perform when an _search query happens?
    2. Do Data Nodes have any role to perform when data is being indexed?
    3. Do any other nodes have any role to perform when data is being searched?

    Or if you could help explain the flow of a search request (which node receives the API call, which node filters the data, which node runs the aggregations, etc.), then that would be really helpful.

    In case it is relevant, then I am on Elastic Search 7.5

    解决方案

    1. Do Ingest nodes have any role to perform when an _search query happens? if it's a dedicated ingest node than no, if it also holds the data(shards and replica) than yes.

    2. Do Data Nodes have any role to perform when data is being indexed? Yes, data nodes actually hold the data(shards and replica), and ultimately they are responsible for indexing and searching this data

    3. Do any other nodes have any role to perform when data is being searched? Yes, please refer to the responsibility of co-ordinating role in ES.

    In short, ingest node just do the transformation of the data, and data nodes actually hold the data, and all the roles can be dedicated or shared to a node in ES.

    Below are the steps in a search request--

    1. Coordinating node receives the request and it can be a dedicated node or data nodes does this work(default).
    2. Coordinating node forwards the request to data nodes, which holds the shards(primary or replica) for your search request.
    3. Data nodes do the local search and send the result back to the coordinating node.
    4. Coordinating node will aggregate the top 10 search results(default is 10) from all nodes and send back the response.

    这篇关于_search查询在Elasticsearch中如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆