title: How to limit query time in elasticsearch?
body: <p>If you use <a href="http://www.elasticsearch.org/guide/reference/query-dsl/query-string-query/">query_string</a> in <a href="http://www.elasticsearch.org/">elasticsearch</a> with an unlucky query over a large dataset, you can almost bring the cluster down, and it can take quite a long time until the query is finished. This can be a serious problem if you allow the users to specify arbitrary query strings.</p>
  
  <p>So, is there a way to limit the time and/or resources the query takes? If you could tell elasticsearch to abort the querying automatically after, say, 10 seconds, that'd help quite a lot.</p>