# SearchContextMissingException: No search context found

**URL:** <https://discuss.elastic.co/t/searchcontextmissingexception-no-search-context-found/24826>\
**Category:** Elasticsearch\
**Created:** [July 2, 2015, 10:19pm UTC](https://discuss.elastic.co/t/searchcontextmissingexception-no-search-context-found/24826 "2015-07-02T22:19:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dave](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@dave](https://discuss.elastic.co/u/dave)\
**Post date:** [July 2, 2015, 10:19pm UTC](https://discuss.elastic.co/t/searchcontextmissingexception-no-search-context-found/24826/1 "2015-07-02T22:19:37Z")

</div>

Hey! I ran a search query on multiple indices, in parallel with a delete index query on those indices. The search failed with this error:

`[2015-06-15 23:51:53,696][INFO][cluster.metadata] [node-ba3d5edd-4e7e-4d5e-959c-7a2637620bdf] [metadata-c4120@16366] deleting index [2015-06-15 23:51:53,776][DEBUG][action.search.type] [node-ba3d5edd-4e7e-4d5e-959c-7a2637620bdf] [2194] Failed to execute fetch phase org.elasticsearch.search.SearchContextMissingException: No search context found for id [2194] at org.elasticsearch.search.SearchService.findContext(SearchService.java:522) at org.elasticsearch.search.SearchService.executeFetchPhase(SearchService.java:492) at org.elasticsearch.search.action.SearchServiceTransportAction$17.call(SearchServiceTransportAction.java:452) at org.elasticsearch.search.action.SearchServiceTransportAction$17.call(SearchServiceTransportAction.java:449) at org.elasticsearch.search.action.SearchServiceTransportAction$23.run(SearchServiceTransportAction.java:559) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) [2015-06-15 23:51:53,836][INFO][cluster.metadata] [node-ba3d5edd-4e7e-4d5e-959c-7a2637620bdf] [metadata-c4120@16576] deleting index`

. Is that supposed to happen?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 2, 2015, 11:51pm UTC](https://discuss.elastic.co/t/searchcontextmissingexception-no-search-context-found/24826/2 "2015-07-02T23:51:20Z")

</div>

If you try to query an index that is deleted, then yes, this is expected.

---

<div class="post-metadata">

**Author:** ![aswan](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@aswan](https://discuss.elastic.co/u/aswan)\
**Post date:** [July 6, 2015, 4:09pm UTC](https://discuss.elastic.co/t/searchcontextmissingexception-no-search-context-found/24826/3 "2015-07-06T16:09:41Z")

</div>

Thanks Mark. I'm unfamiliar with ES internals at this level of detail but the name and wording in this exception make it sound like something more general than the scenario that Dave describes. Is it possible to characterize all the conditions under which a query can fail with a `SearchContentMissingException`?

To make it concrete, I would like to ignore this error if it happens in the way described in the original question (simultaneously querying and deleting an index) but ignoring every instance of this exception makes me nervous. Are there any resource other than the source code and the discussion board (eg documentaiton?) for understanding and interpreting these errors?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 6, 2015, 9:00pm UTC](https://discuss.elastic.co/t/searchcontextmissingexception-no-search-context-found/24826/4 "2015-07-06T21:00:46Z")

</div>

Unfortunately, not at this stage.

---

<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:03am UTC](https://discuss.elastic.co/t/searchcontextmissingexception-no-search-context-found/24826/5 "2017-07-06T00:03:21Z")

</div>


