# How es-hadoop get data

**URL:** https://discuss.elastic.co/t/how-es-hadoop-get-data/35524
**Category:** Elasticsearch
**Tags:** es-hadoop
**Created:** [November 25, 2015, 8:02am UTC](https://discuss.elastic.co/t/how-es-hadoop-get-data/35524 "2015-11-25T08:02:57Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![t7s](https://avatars.discourse-cdn.com/v4/letter/t/b38774/32.png) [@t7s](https://discuss.elastic.co/u/t7s)
#### Post date: [November 25, 2015, 8:02am UTC](https://discuss.elastic.co/t/how-es-hadoop-get-data/35524/1 "2015-11-25T08:02:57Z")

</div>

I know the es-hadoop will find shards to get data, but  
when dealing with shards, is es-hadoop get all the data then hadoop/spark process the rest steps to get wanted data or es-hadoop use routing mechanism to query to get wanted data

For example, when I use es-hadoop to find records satisfied gender=male, those records will be returned by shards directly or es-hadoop got all data from target shards then obtain the result by iterate whole data？

---

<div class="post-metadata">

### Author: ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)
#### Post date: [November 25, 2015, 9:26pm UTC](https://discuss.elastic.co/t/how-es-hadoop-get-data/35524/2 "2015-11-25T21:26:55Z")

</div>

This is explain in the reference doc, in particular in the [architecture](https://www.elastic.co/guide/en/elasticsearch/hadoop/master/arch.html) chapter.  
In short, es-hadoop will get _only_ the data needed from each shard; it would be highly ineffective and frankly pointless to get all the data and filter things in memory (why would it do that when ES can do all this itself)?

---

<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: [July 6, 2017, 1:27pm UTC](https://discuss.elastic.co/t/how-es-hadoop-get-data/35524/3 "2017-07-06T13:27:04Z")

</div>


