# Data query issues with elasticsearch 6.8

**URL:** <https://discuss.elastic.co/t/data-query-issues-with-elasticsearch-6-8/237637>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [June 18, 2020, 12:58pm UTC](https://discuss.elastic.co/t/data-query-issues-with-elasticsearch-6-8/237637 "2020-06-18T12:58:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sammi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sammi/32/46023_2.png) [@sammi](https://discuss.elastic.co/u/sammi)\
**Post date:** [June 18, 2020, 12:58pm UTC](https://discuss.elastic.co/t/data-query-issues-with-elasticsearch-6-8/237637/1 "2020-06-18T12:58:09Z")

</div>

we have 5 node cassandra and 3 node elasticsearch for indexes in a cluster , For smaller count data retrieval is working with queries but when there are large count query is failing with below error.

```auto
method [POST], host [http://es01:9200], URI [/_search/scroll], status line [HTTP/1.1 404 Not Found]
{"error":{"root_cause":[{"type":"search_context_missing_exception","reason":"No search context found for id [5]"},{"type":"search_context_missing_exception","reason":"No search context found for id [7]"},{"type":"search_context_missing_exception","reason":"No search context found for id [8]"},{"type":"search_context_missing_exception","reason":"No search context found for id [6]"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":-1,"index":null,"reason":{"type":"search_context_missing_exception","reason":"No search context found for id [5]"}},{"shard":-1,"index":null,"reason":{"type":"search_context_missing_exception","reason":"No search context found for id [7]"}},{"shard":-1,"index":null,"reason":{"type":"search_context_missing_exception","reason":"No search context found for id [8]"}},{"shard":-1,"index":null,"reason":{"type":"search_context_missing_exception","reason":"No search context found for id [6]"}}],"caused_by":{"type":"search_context_missing_exception","reason":"No search context found for id [6]"}},"status":404}

```

Same query works fine with single node cassandra and elasticsearch, Are we missing any thing in cluster ?

please suggest.

---

<div class="post-metadata">

**Author:** ![sammi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sammi/32/46023_2.png) [@sammi](https://discuss.elastic.co/u/sammi)\
**Post date:** [June 22, 2020, 5:48am UTC](https://discuss.elastic.co/t/data-query-issues-with-elasticsearch-6-8/237637/2 "2020-06-22T05:48:44Z")

</div>

Can anyone give some suggestion on this ? Let me know if you need more information.

---

<div class="post-metadata">

**Author:** ![NerdSec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nerdsec/32/22056_2.png) [@NerdSec](https://discuss.elastic.co/u/NerdSec)\
**Post date:** [June 22, 2020, 7:41am UTC](https://discuss.elastic.co/t/data-query-issues-with-elasticsearch-6-8/237637/3 "2020-06-22T07:41:13Z")

</div>

Hi Sunny,

Please format your code for better readability.

The errors states that the search context is missing. Are you ensuring that the search context is alive while you query the scroll context? [https://www.elastic.co/guide/en/elasticsearch/reference/6.8/search-request-scroll.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.8/search-request-scroll.html)

Also, any specific reason for using scroll? Try leveraging search after if you need [stateless query execution.](https://www.elastic.co/guide/en/elasticsearch/reference/6.8/search-request-search-after.html)

---

<div class="post-metadata">

**Author:** ![sammi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sammi/32/46023_2.png) [@sammi](https://discuss.elastic.co/u/sammi)\
**Post date:** [June 22, 2020, 7:50am UTC](https://discuss.elastic.co/t/data-query-issues-with-elasticsearch-6-8/237637/4 "2020-06-22T07:50:03Z")

</div>

Hi,

We are getting this error while querying using janusgraph/gremlin query. we are not using scroll here. The data is being indexed in elasticsearch and cassandra as being backend.

Which doesn't make any sense to us is same query working in single elasticsearch but when we moved to multi/3 node elasticsearch it is failing. Is it due to data not being shared/sharding issue ?

We have 3 elasticsearch nodes as master/data/ingester for all 3 nodes. Do we need to have specific configuration when we move to cluster .

Please suggest.

---

<div class="post-metadata">

**Author:** ![NerdSec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nerdsec/32/22056_2.png) [@NerdSec](https://discuss.elastic.co/u/NerdSec)\
**Post date:** [June 23, 2020, 1:29am UTC](https://discuss.elastic.co/t/data-query-issues-with-elasticsearch-6-8/237637/5 "2020-06-23T01:29:48Z")

</div>

There is no specific setting one has to perform in order to move to a multi-node cluster. Data is broken into shards depending on your index configuration.

The error that you have posted usually comes when the search context is not alive anymore. Is there an option in Janusgraph to maybe increase the search context time duration while making the query?

Without much information about the actual query being run on ES, it is difficult to give any solutions or pointers.

---

<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 21, 2020, 1:29am UTC](https://discuss.elastic.co/t/data-query-issues-with-elasticsearch-6-8/237637/6 "2020-07-21T01:29:50Z")

</div>

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