# Reduce the number of results returned in elasticsearch

**URL:** https://discuss.elastic.co/t/reduce-the-number-of-results-returned-in-elasticsearch/16582
**Category:** Elasticsearch
**Created:** [March 25, 2014, 9:57am UTC](https://discuss.elastic.co/t/reduce-the-number-of-results-returned-in-elasticsearch/16582 "2014-03-25T09:57:12Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![soumya\_sengupta](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@soumya\_sengupta](https://discuss.elastic.co/u/soumya_sengupta)
#### Post date: [March 25, 2014, 9:57am UTC](https://discuss.elastic.co/t/reduce-the-number-of-results-returned-in-elasticsearch/16582/1 "2014-03-25T09:57:12Z")

</div>

I am using an ngram analyzer for doing auto complete search on a particular  
field using elasticsearch.  
By default I have set the number of results to return to 10 using "size:10"  
inside the query.

But what I want is that as my search nears the exact match, the results  
returned by elastic search should reduce

For example  
If searching for: "fl"  
Will return : "flake", "flower", "fleet", "flank", "flatter".

If searching for: "fla"  
Will return : "flan","flank", "flatter".

If searching for: "flan"  
Will return : "flan","flank".

Right now all results are returned even if i search for "flan"  
I am also using phonetic search.

Regards,  
Soumya

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b29221de-e7bb-4e6e-a0a5-6791da47da7b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b29221de-e7bb-4e6e-a0a5-6791da47da7b%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Binh\_Ly\_2](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@Binh\_Ly\_2](https://discuss.elastic.co/u/Binh_Ly_2)
#### Post date: [March 25, 2014, 1:38pm UTC](https://discuss.elastic.co/t/reduce-the-number-of-results-returned-in-elasticsearch/16582/2 "2014-03-25T13:38:23Z")

</div>

You probably want to override the search\_analyzer to make sure that the  
ngram is not applied to your query string. For example, if you use the  
match query, just set analyzer in your query to something like standard.

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/42766722-f246-43c5-922c-4265e08445eb%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/42766722-f246-43c5-922c-4265e08445eb%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:40am UTC](https://discuss.elastic.co/t/reduce-the-number-of-results-returned-in-elasticsearch/16582/3 "2017-07-06T01:40:48Z")

</div>


