# How elasticsearch deals with the result of each shard?

**URL:** <https://discuss.elastic.co/t/how-elasticsearch-deals-with-the-result-of-each-shard/221864>\
**Category:** Elasticsearch\
**Created:** [March 3, 2020, 11:11am UTC](https://discuss.elastic.co/t/how-elasticsearch-deals-with-the-result-of-each-shard/221864 "2020-03-03T11:11:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wall](https://avatars.discourse-cdn.com/v4/letter/w/7feea3/32.png) [@wall](https://discuss.elastic.co/u/wall)\
**Post date:** [March 3, 2020, 11:11am UTC](https://discuss.elastic.co/t/how-elasticsearch-deals-with-the-result-of-each-shard/221864/1 "2020-03-03T11:11:46Z")

</div>

Hi Elasticians!

I was thinking in how Elasticsearch deals with the results from each shard and how it can lead to imprecise results, once each shard only knows about its data (I also read we can make it work precisely)

And all of a sudden I came to the conclusion that I didn't had any idea about where is the data gathered and processed to return a single answer to the client.

is it the master node that does this work? is it the data node? if yes which data node does this job? other?

Thank you for the help

---

<div class="post-metadata">

**Author:** ![wall](https://avatars.discourse-cdn.com/v4/letter/w/7feea3/32.png) [@wall](https://discuss.elastic.co/u/wall)\
**Post date:** [March 24, 2020, 11:51am UTC](https://discuss.elastic.co/t/how-elasticsearch-deals-with-the-result-of-each-shard/221864/2 "2020-03-24T11:51:06Z")

</div>

I found out the answer 🙂

Every node is a coordinator node.  
the coordination happens in two phases:

_scatter_  
the request is sent to the nodes  
and

_gather_  
the replies are sent back to the coordinator and reduced to a single answer.

more in:  
[elastic.co](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-node.html#master-node)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 21, 2020, 11:51am UTC](https://discuss.elastic.co/t/how-elasticsearch-deals-with-the-result-of-each-shard/221864/3 "2020-04-21T11:51:08Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
