# Terminate long running queries to protect the system from DoS

**URL:** <https://discuss.elastic.co/t/terminate-long-running-queries-to-protect-the-system-from-dos/23811>\
**Category:** Elasticsearch\
**Created:** [June 17, 2015, 8:04am UTC](https://discuss.elastic.co/t/terminate-long-running-queries-to-protect-the-system-from-dos/23811 "2015-06-17T08:04:54Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [June 17, 2015, 10:33am UTC](https://discuss.elastic.co/t/terminate-long-running-queries-to-protect-the-system-from-dos/23811/10 "2015-06-17T10:33:50Z")

</div>

Aggregations are conducted by tapping off results from the search's collection stream. A timeout will terminate this operation on the shard in question returning any interim results it may have gathered so far along with a flag to indicate the timeout status. This is reported in the final results.

---

_[View the full topic](https://discuss.elastic.co/t/terminate-long-running-queries-to-protect-the-system-from-dos/23811)._
