# Query timing out

**URL:** <https://discuss.elastic.co/t/query-timing-out/20876>\
**Category:** Elasticsearch\
**Created:** [November 20, 2014, 8:54pm UTC](https://discuss.elastic.co/t/query-timing-out/20876 "2014-11-20T20:54:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Warner\_Onstine](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warner_onstine/32/1086_2.png) [@Warner\_Onstine](https://discuss.elastic.co/u/Warner_Onstine)\
**Post date:** [November 20, 2014, 8:54pm UTC](https://discuss.elastic.co/t/query-timing-out/20876/1 "2014-11-20T20:54:10Z")

</div>

Hi all, hoping to get some help with this. I am trying to retrieve the  
latest tweet by a person. I'm using the javascript library. Using the  
elastic.js library to help build a query. Here is the query generated:  
{"query":  
{"match":  
{"talent\_id":{"query":"546e50b989fe3400007230c4"}}},  
"sort":[{"post\_date":{"order":"desc"}}],"size":1}

When I run this query through curl it works just fine, but when I run it  
through the elasticsearch JS lib it times out regularly (not always but a  
lot). The curl one comes back almost immediately which I would expect.

Any thoughts on why the JS lib times out? Or a better way to write my query  
above to get what I want?

Thank you in advance!

-warner

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAJNTuMBj%3DwoYzBb1D5CAv9n6LgRm-n\_am3yafT99-2tNhWRAZg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAJNTuMBj%3DwoYzBb1D5CAv9n6LgRm-n_am3yafT99-2tNhWRAZg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:48am UTC](https://discuss.elastic.co/t/query-timing-out/20876/2 "2017-07-06T00:48:33Z")

</div>


