title: Elastic Search limit results
body: <p>In MySQL I can do something like:</p>
  
  <pre><code>  SELECT id FROM table WHERE field = 'foo' LIMIT 5
  </code></pre>
  
  <p>If the table has 10,000 rows, then this query is way way faster than if I left out the LIMIT part.</p>
  
  <p>In ElasticSearch, I've got the following:</p>
  
  <pre><code> {
      "query":{
         "fuzzy_like_this_field":{
            "body":{
               "like_text":"REALLY LONG (snip) TEXT HERE",
               "max_query_terms":1,
               "min_similarity":0.95,
               "ignore_tf":true
            }
         }
      }
   }
  </code></pre>
  
  <p>When I run this search, it takes a few seconds, whereas mysql can return results for the same query in far, far less time.</p>
  
  <p>If I pass in the size parameter (set to 1), it successfully only returns 1 result, but the query itself isn't any faster than if I had set the size to unlimited and returned all the results. I suspect the query is being run in its entirety and only 1 result is being returned after the query is done processing. This means the "size" attribute is useless for my purposes.</p>
  
  <p>Is there any way to have my search stop searching as soon as it finds a single record that matches the fuzzy search, rather than processing every record in the index before returning a response? Am I misunderstanding something more fundamental about this?</p>
  
  <p>Thanks in advance.</p>