# Elastic search : How to control result set of any search query

**URL:** https://discuss.elastic.co/t/elastic-search-how-to-control-result-set-of-any-search-query/10766
**Category:** Elasticsearch
**Created:** [February 17, 2013, 2:25pm UTC](https://discuss.elastic.co/t/elastic-search-how-to-control-result-set-of-any-search-query/10766 "2013-02-17T14:25:46Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![mohit\_Kumar](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@mohit\_Kumar](https://discuss.elastic.co/u/mohit_Kumar)
#### Post date: [February 17, 2013, 2:25pm UTC](https://discuss.elastic.co/t/elastic-search-how-to-control-result-set-of-any-search-query/10766/1 "2013-02-17T14:25:46Z")

</div>

hello folks,

```
          Is there any way to control the size of result set of any

```

query in elastic search.

thanks and regards  
Mohit Kumar Yadav

--  
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: ![hoong](https://avatars.discourse-cdn.com/v4/letter/h/8edcca/32.png) [@hoong](https://discuss.elastic.co/u/hoong)
#### Post date: [February 17, 2013, 2:30pm UTC](https://discuss.elastic.co/t/elastic-search-how-to-control-result-set-of-any-search-query/10766/2 "2013-02-17T14:30:26Z")

</div>

As I know, you can control the size of result by using \*size \*option like  
sample query below...  
{  
"from" : 0,

- "size" : 30, \<--- here, you can get 30 search result.\*  
"filter" : {  
"or" : {  
"filters" : [ {  
"and" : {  
"filters" : [ {  
"range" : {  
"save\_time" : {  
"from" : "20130215195941",  
"to" : "20130215200440",  
"include\_lower" : true,  
"include\_upper" : true  
}  
}  
}, {  
"range" : {  
"d\_port" : {  
"from" : null,  
"to" : 80,  
"include\_lower" : true,  
"include\_upper" : false  
}  
}  
}, {  
"range" : {  
"d\_port" : {  
"from" : -1,  
"to" : null,  
"include\_lower" : true,  
"include\_upper" : true  
}  
}  
}, {  
"term" : {  
"reason" : "tcp fin"  
}  
}, {  
"term" : {  
"dev\_id" : "1"  
}  
} ]  
}  
} ]  
}  
}  
}

2013/2/17 Mohit Kumar Yadav [mohit.kumar.ngi@gmail.com](mailto:mohit.kumar.ngi@gmail.com)

> hello folks,
> 
> ```
> Is there any way to control the size of result set of any
> 
> ```
> 
> query in Elasticsearch.
> 
> thanks and regards  
> Mohit Kumar Yadav
> 
> --  
> 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).

--

* * *

전동규  
연세대학교 정보산업공학과  
지능 웹 비즈니스 연구실  
[jdkclub85@gmail.com](mailto:jdkclub85@gmail.com) / 010-4142-4160

* * *

--  
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: ![mohit\_Kumar](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@mohit\_Kumar](https://discuss.elastic.co/u/mohit_Kumar)
#### Post date: [February 17, 2013, 2:45pm UTC](https://discuss.elastic.co/t/elastic-search-how-to-control-result-set-of-any-search-query/10766/3 "2013-02-17T14:45:27Z")

</div>

hi hoong  
thanks for reply. Is there any way to control size of results set of a  
particular field.

On Sunday, February 17, 2013 7:55:46 PM UTC+5:30, Mohit Kumar Yadav wrote:

> hello folks,
> 
> ```
> Is there any way to control the size of result set of any 
> 
> ```
> 
> query in Elasticsearch.
> 
> thanks and regards  
> Mohit Kumar Yadav

--  
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:51am UTC](https://discuss.elastic.co/t/elastic-search-how-to-control-result-set-of-any-search-query/10766/4 "2017-07-06T02:51:08Z")

</div>


