# Elasticsearch returning empty result

**URL:** <https://discuss.elastic.co/t/elasticsearch-returning-empty-result/180962>\
**Category:** Elasticsearch\
**Created:** [May 14, 2019, 9:07am UTC](https://discuss.elastic.co/t/elasticsearch-returning-empty-result/180962 "2019-05-14T09:07:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gaurav](https://avatars.discourse-cdn.com/v4/letter/g/b487fb/32.png) [@gaurav](https://discuss.elastic.co/u/gaurav)\
**Post date:** [May 14, 2019, 9:07am UTC](https://discuss.elastic.co/t/elasticsearch-returning-empty-result/180962/1 "2019-05-14T09:07:43Z")

</div>

I am using a 2.3 version elastic search.  
Sometimes, elastic search returns an empty result even when data is present.  
It usually gives the right data on retry. But why does it return empty in the first try.  
Any known issues or pointers which can help me here.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 14, 2019, 11:01am UTC](https://discuss.elastic.co/t/elasticsearch-returning-empty-result/180962/2 "2019-05-14T11:01:33Z")

</div>

Could you share the full response when both cases are happening?

BTW 2.3 is super old and not maintained anymore.

---

<div class="post-metadata">

**Author:** ![gaurav](https://avatars.discourse-cdn.com/v4/letter/g/b487fb/32.png) [@gaurav](https://discuss.elastic.co/u/gaurav)\
**Post date:** [May 14, 2019, 12:15pm UTC](https://discuss.elastic.co/t/elasticsearch-returning-empty-result/180962/3 "2019-05-14T12:15:27Z")

</div>

I am using the Jest client for querying the elastic search. The Jest client returns the object for search result which gives me isSucceeded as TRUE. And the data is not present in the search result.  
The same query is fired after 10secinds and I get the expected data.  
The query that was fired was similar to  
{  
"query": {  
"bool": {  
"must": [{  
"match": {  
"ProgramId": "SampleProgramId"  
}  
}, {  
"match": {  
"TraderId": "SampleTrader"  
}  
}, {  
"match": {  
"CustomerId": "SampleCustomer"  
}  
}, {  
"match": {  
"TradeStatus": "SampleStatus"  
}  
}],  
"filter": [{  
"range": {  
"TradeStartDate": {  
"gte": 123456,  
"lte": 654321  
}  
}  
}]  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 14, 2019, 3:23pm UTC](https://discuss.elastic.co/t/elasticsearch-returning-empty-result/180962/4 "2019-05-14T15:23:31Z")

</div>

But is there a way to debug and print what Jest received as the http response and share it please?

---

<div class="post-metadata">

**Author:** ![gaurav](https://avatars.discourse-cdn.com/v4/letter/g/b487fb/32.png) [@gaurav](https://discuss.elastic.co/u/gaurav)\
**Post date:** [May 15, 2019, 12:53pm UTC](https://discuss.elastic.co/t/elasticsearch-returning-empty-result/180962/5 "2019-05-15T12:53:57Z")

</div>

This doesn't happen often. It happened twice in past 20 days. I have anyways put the logs, but not sure about the next occurrence

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 15, 2019, 3:02pm UTC](https://discuss.elastic.co/t/elasticsearch-returning-empty-result/180962/6 "2019-05-15T15:02:38Z")

</div>

I just wanted to know if some shards were failing during that specific search. This is part of the response.

---

<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:** [June 12, 2019, 3:02pm UTC](https://discuss.elastic.co/t/elasticsearch-returning-empty-result/180962/7 "2019-06-12T15:02:52Z")

</div>

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