# How to fetch stream data from ES using node.js?

**URL:** <https://discuss.elastic.co/t/how-to-fetch-stream-data-from-es-using-node-js/24223>\
**Category:** Elasticsearch\
**Created:** [June 23, 2015, 10:32pm UTC](https://discuss.elastic.co/t/how-to-fetch-stream-data-from-es-using-node-js/24223 "2015-06-23T22:32:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mahebub\_Sayyed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mahebub_sayyed/32/68237_2.png) [@Mahebub\_Sayyed](https://discuss.elastic.co/u/Mahebub_Sayyed)\
**Post date:** [June 23, 2015, 10:32pm UTC](https://discuss.elastic.co/t/how-to-fetch-stream-data-from-es-using-node-js/24223/1 "2015-06-23T22:32:47Z")

</div>

I want to display realtime data from ES to my app.  
I am using node.js to fetch data, What will be the best option to fetch realtime data from ES?  
I tried to example "Stream search results from Elasticsearch" from npm elasticsearch-stream but its not working.

---

<div class="post-metadata">

**Author:** ![eperry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eperry/32/551_2.png) [@eperry](https://discuss.elastic.co/u/eperry)\
**Post date:** [June 24, 2015, 2:39am UTC](https://discuss.elastic.co/t/how-to-fetch-stream-data-from-es-using-node-js/24223/2 "2015-06-24T02:39:01Z")

</div>

Check out scroll

[https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html)

---

<div class="post-metadata">

**Author:** ![Mahebub\_Sayyed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mahebub_sayyed/32/68237_2.png) [@Mahebub\_Sayyed](https://discuss.elastic.co/u/Mahebub_Sayyed)\
**Post date:** [June 24, 2015, 7:48am UTC](https://discuss.elastic.co/t/how-to-fetch-stream-data-from-es-using-node-js/24223/3 "2015-06-24T07:48:24Z")

</div>

Thanks @eperry for the reply.  
I checked **scroll** but its different than my requirement.  
It says **_Scrolling is not intended for real time user requests, but rather for processing large amounts of data_**.  
Actually my requirement is in first attempt I got data from ES.  
Whenever New data will be available in ES which is not fetched yet that should be fetch.  
For example I am inserting tweets inside ES from twitter-stream. I want to display all new (realtime) tweets available in ES automatically Without any request from client.

---

<div class="post-metadata">

**Author:** ![eperry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eperry/32/551_2.png) [@eperry](https://discuss.elastic.co/u/eperry)\
**Post date:** [June 25, 2015, 12:39pm UTC](https://discuss.elastic.co/t/how-to-fetch-stream-data-from-es-using-node-js/24223/4 "2015-06-25T12:39:53Z")

</div>

You'll have to keep track of the time from each search on your client level, other then scrol there is no way to "save" your position inherent to ES

You could try the Elastic Search Watcher application.

---

<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, 12:05am UTC](https://discuss.elastic.co/t/how-to-fetch-stream-data-from-es-using-node-js/24223/5 "2017-07-06T00:05:25Z")

</div>


