# Limiting results to 100 problem

**URL:** https://discuss.elastic.co/t/limiting-results-to-100-problem/11589
**Category:** Elasticsearch
**Created:** [April 15, 2013, 4:37pm UTC](https://discuss.elastic.co/t/limiting-results-to-100-problem/11589 "2013-04-15T16:37:02Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Andy\_Bajka\_2](https://avatars.discourse-cdn.com/v4/letter/a/e19adc/32.png) [@Andy\_Bajka\_2](https://discuss.elastic.co/u/Andy_Bajka_2)
#### Post date: [April 15, 2013, 4:37pm UTC](https://discuss.elastic.co/t/limiting-results-to-100-problem/11589/1 "2013-04-15T16:37:02Z")

</div>

I have the following query:

{  
"from" : 0, "size" : 100,  
"sort" : [  
{ "date" : {"order" : "desc"} }  
],  
"query": {  
"filtered": {  
"query": {  
"match\_all": {  
}  
},  
"filter": {  
"bool": {  
"must": {  
"term": {  
"user": "' . $user\_id . '"  
}  
},  
"must\_not": {  
"range": {  
"node": {  
"from": 100,  
"to": 100  
}  
}  
}  
}  
}  
}  
}  
}

When I run this query with user\_id equal to 1, I get 97 results instead of  
the expected 100 results. Are there some tests I can do to determine why  
there's this small discrepancy?

Thank you.

--  
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: ![Andy\_Bajka\_2](https://avatars.discourse-cdn.com/v4/letter/a/e19adc/32.png) [@Andy\_Bajka\_2](https://discuss.elastic.co/u/Andy_Bajka_2)
#### Post date: [April 15, 2013, 5:06pm UTC](https://discuss.elastic.co/t/limiting-results-to-100-problem/11589/2 "2013-04-15T17:06:43Z")

</div>

I just noticed that other user\_id's get different results, the one I just  
saw got 91 results. These members have many more to exceed the 100 limit,  
so there must be something that is throwing off the size variable in the  
query.

--  
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:41am UTC](https://discuss.elastic.co/t/limiting-results-to-100-problem/11589/3 "2017-07-06T02:41:00Z")

</div>


