# How can I cancel a search request?

**URL:** <https://discuss.elastic.co/t/how-can-i-cancel-a-search-request/11625>\
**Category:** Elasticsearch\
**Created:** [April 18, 2013, 7:46am UTC](https://discuss.elastic.co/t/how-can-i-cancel-a-search-request/11625 "2013-04-18T07:46:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hoony](https://avatars.discourse-cdn.com/v4/letter/h/7ab992/32.png) [@Hoony](https://discuss.elastic.co/u/Hoony)\
**Post date:** [April 18, 2013, 7:46am UTC](https://discuss.elastic.co/t/how-can-i-cancel-a-search-request/11625/1 "2013-04-18T07:46:16Z")

</div>

Hi all,  
Are there some way to cancel a search request?  
Sometimes, there is the request which costs too much time, so I want  
to cancel it?  
Does ES support this kind of function or API to cancel the search  
request?

```
 One more question, If there are two request A and B. 
 A is sent at first time, and it is running long time. when I send B 

```

after A, if it is possible that B process cover A?

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)\
**Post date:** [April 18, 2013, 8:16am UTC](https://discuss.elastic.co/t/how-can-i-cancel-a-search-request/11625/2 "2013-04-18T08:16:46Z")

</div>

No, you can't cancel a running request. Perhaps the `timeout` option is  
useful in your situation:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

This allows you to timebox a search.

On 18 April 2013 09:46, Hoony [monkeyboywon@gmail.com](mailto:monkeyboywon@gmail.com) wrote:

> Hi all,  
> Are there some way to cancel a search request?  
> Sometimes, there is the request which costs too much time, so I want  
> to cancel it?  
> Does ES support this kind of function or API to cancel the search  
> request?
> 
> ```
> One more question, If there are two request A and B.
> A is sent at first time, and it is running long time. when I send B
> 
> ```
> 
> after A, if it is possible that B process cover A?
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
Met vriendelijke groet,

Martijn van Groningen

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![caphrim007](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/caphrim007/32/2379_2.png) [@caphrim007](https://discuss.elastic.co/u/caphrim007)\
**Post date:** [April 19, 2013, 2:58am UTC](https://discuss.elastic.co/t/how-can-i-cancel-a-search-request/11625/3 "2013-04-19T02:58:16Z")

</div>

Is ES's inability to cancel search, by design? Or just something that  
hasn't been gotten around to being written yet?

On Thursday, April 18, 2013 3:16:46 AM UTC-5, Martijn v Groningen wrote:

> No, you can't cancel a running request. Perhaps the `timeout` option is  
> useful in your situation:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/uri-request/)
> 
> This allows you to timebox a search.
> 
> On 18 April 2013 09:46, Hoony \<[monkey...@gmail.com](mailto:monkey...@gmail.com) \<javascript:\>\> wrote:
> 
> > Hi all,  
> > Are there some way to cancel a search request?  
> > Sometimes, there is the request which costs too much time, so I want  
> > to cancel it?  
> > Does ES support this kind of function or API to cancel the search  
> > request?
> > 
> > ```
> > One more question, If there are two request A and B. 
> > A is sent at first time, and it is running long time. when I send B 
> > 
> > ```
> > 
> > after A, if it is possible that B process cover A?
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> Met vriendelijke groet,
> 
> Martijn van Groningen

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)\
**Post date:** [April 19, 2013, 9:23am UTC](https://discuss.elastic.co/t/how-can-i-cancel-a-search-request/11625/4 "2013-04-19T09:23:22Z")

</div>

We might have something like this in the future. What kind of searches are  
you executing that take so much time? Maybe these searches can be optimized.

On 19 April 2013 04:58, caphrim007 [caphrim007@gmail.com](mailto:caphrim007@gmail.com) wrote:

> Is ES's inability to cancel search, by design? Or just something that  
> hasn't been gotten around to being written yet?
> 
> On Thursday, April 18, 2013 3:16:46 AM UTC-5, Martijn v Groningen wrote:
> 
> > No, you can't cancel a running request. Perhaps the `timeout` option is  
> > useful in your situation:  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/ **guide/reference/api/search/** uri-request/)[http://www.elasticsearch.org/guide/reference/api/search/uri-request/](http://www.elasticsearch.org/guide/reference/api/search/uri-request/)
> > 
> > This allows you to timebox a search.
> > 
> > On 18 April 2013 09:46, Hoony [monkey...@gmail.com](mailto:monkey...@gmail.com) wrote:
> > 
> > > Hi all,  
> > > Are there some way to cancel a search request?  
> > > Sometimes, there is the request which costs too much time, so I  
> > > want to cancel it?  
> > > Does ES support this kind of function or API to cancel the search  
> > > request?
> > > 
> > > ```
> > > One more question, If there are two request A and B.
> > > A is sent at first time, and it is running long time. when I send B
> > > 
> > > ```
> > > 
> > > after A, if it is possible that B process cover A?
> > > 
> > > --  
> > > 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 elasticsearc...@\*\*[googlegroups.com](http://googlegroups.com).
> > > 
> > > For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out)  
> > > .
> > 
> > --  
> > Met vriendelijke groet,
> > 
> > Martijn van Groningen

--  
Met vriendelijke groet,

Martijn van Groningen

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:40am UTC](https://discuss.elastic.co/t/how-can-i-cancel-a-search-request/11625/5 "2017-07-06T02:40:28Z")

</div>


