# Get all the records without the need of specifying the size

**URL:** <https://discuss.elastic.co/t/get-all-the-records-without-the-need-of-specifying-the-size/19543>\
**Category:** Elasticsearch\
**Created:** [September 1, 2014, 2:02am UTC](https://discuss.elastic.co/t/get-all-the-records-without-the-need-of-specifying-the-size/19543 "2014-09-01T02:02:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Drole](https://avatars.discourse-cdn.com/v4/letter/d/9de053/32.png) [@Drole](https://discuss.elastic.co/u/Drole)\
**Post date:** [September 1, 2014, 2:02am UTC](https://discuss.elastic.co/t/get-all-the-records-without-the-need-of-specifying-the-size/19543/1 "2014-09-01T02:02:33Z")

</div>

Hi,

I need to query all the URL in my index using terms since I only want to  
get the unique URLs, but the number of returned record is determined by the  
size, which for the example below is 10.  
What should i do to query all URL in my index without specifying the size?

I actually just used the default query from Kibana below.

curl -XGET '[http://localhost/](http://localhost/)/\_search?pretty' -d '{  
"facets": {  
"terms": {  
"terms": {  
"field": "URL.not\_analyzed",  
"size": 10,  
"order": "count"  
},  
"facet\_filter": {  
"fquery": {  
"query": {  
"filtered": {  
"query": {  
"bool": {  
"should": [  
{  
"query\_string": {  
"query": "\*"  
}  
}  
]  
}  
},  
"filter": {  
"bool": {  
"must": [  
{  
"range": {  
"ArrivalTime": {  
"from": 1409362530572,  
"to": 1409535330572  
}  
}  
}  
]  
}  
}  
}  
}  
}  
}  
}  
},  
"size": 0  
}'

--  
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/c3c7de5e-ffc9-4dc5-9af3-79309d9a7f94%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c3c7de5e-ffc9-4dc5-9af3-79309d9a7f94%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![vineeth\_mohan\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vineeth_mohan_2/32/747_2.png) [@vineeth\_mohan\_2](https://discuss.elastic.co/u/vineeth_mohan_2)\
**Post date:** [September 1, 2014, 2:47am UTC](https://discuss.elastic.co/t/get-all-the-records-without-the-need-of-specifying-the-size/19543/2 "2014-09-01T02:47:06Z")

</div>

Hello Drole ,

You will need to scan over all the documents.  
This means that you will need to iterate over every N feeds at a time to  
fetch all the documents , it might not be possible in a single call.

It is possible to do this in 2 calls , first to get the size of the index  
and second by setting the size of the hits.  
But this is highly not recommended and might lead to possible crash. -

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Thanks  
Vineeth

On Mon, Sep 1, 2014 at 7:32 AM, Drole [rodelm@gmail.com](mailto:rodelm@gmail.com) wrote:

> Hi,
> 
> I need to query all the URL in my index using terms since I only want to  
> get the unique URLs, but the number of returned record is determined by the  
> size, which for the example below is 10.  
> What should i do to query all URL in my index without specifying the size?
> 
> I actually just used the default query from Kibana below.
> 
> curl -XGET '[http://localhost/](http://localhost/)/\_search?pretty' -d '{  
> "facets": {  
> "terms": {  
> "terms": {  
> "field": "URL.not\_analyzed",  
> "size": 10,  
> "order": "count"  
> },  
> "facet\_filter": {  
> "fquery": {  
> "query": {  
> "filtered": {  
> "query": {  
> "bool": {  
> "should": [  
> {  
> "query\_string": {  
> "query": "\*"  
> }  
> }  
> ]  
> }  
> },  
> "filter": {  
> "bool": {  
> "must": [  
> {  
> "range": {  
> "ArrivalTime": {  
> "from": 1409362530572,  
> "to": 1409535330572  
> }  
> }  
> }  
> ]  
> }  
> }  
> }  
> }  
> }  
> }  
> }  
> },  
> "size": 0  
> }'
> 
> --  
> 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/c3c7de5e-ffc9-4dc5-9af3-79309d9a7f94%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c3c7de5e-ffc9-4dc5-9af3-79309d9a7f94%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/c3c7de5e-ffc9-4dc5-9af3-79309d9a7f94%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/c3c7de5e-ffc9-4dc5-9af3-79309d9a7f94%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CAGdPd5mzo4zs-Wou5U32qCbkG%3DjbYkFbvRj\_niHiaZp4xPRBew%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGdPd5mzo4zs-Wou5U32qCbkG%3DjbYkFbvRj_niHiaZp4xPRBew%40mail.gmail.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:05am UTC](https://discuss.elastic.co/t/get-all-the-records-without-the-need-of-specifying-the-size/19543/3 "2017-07-06T01:05:15Z")

</div>


