# Missing results from es when using simple curl

**URL:** <https://discuss.elastic.co/t/missing-results-from-es-when-using-simple-curl/9585>\
**Category:** Elasticsearch\
**Created:** [November 6, 2012, 7:07pm UTC](https://discuss.elastic.co/t/missing-results-from-es-when-using-simple-curl/9585 "2012-11-06T19:07:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dinesh\_Sriram](https://avatars.discourse-cdn.com/v4/letter/d/96bed5/32.png) [@Dinesh\_Sriram](https://discuss.elastic.co/u/Dinesh_Sriram)\
**Post date:** [November 6, 2012, 7:07pm UTC](https://discuss.elastic.co/t/missing-results-from-es-when-using-simple-curl/9585/1 "2012-11-06T19:07:44Z")

</div>

I am trying out elastic search for the first time. I just have 1 node and 1  
index.

curl -XPUT [http://localhost:9200/testing/dummy/1](http://localhost:9200/testing/dummy/1) -d '{  
"snapshotTime" : "2012-10-31T13:31:21",  
"ratio" : "50",  
"description" : "sample description"

}'

I have indexed 500 such dummies to index 'testing'.  
[http://localhost:9200/testing/dummy/1](http://localhost:9200/testing/dummy/1)  
.  
.  
.  
.  
[http://localhost:9200/testing/dummy/500](http://localhost:9200/testing/dummy/500)

Now, when I tried a matchAll query with this data set,

curl -XGET '[http://localhost:9202/\_all/\_search?pretty=true](http://localhost:9202/_all/_search?pretty=true)' -d '  
{  
"query" : {  
"matchAll" : {}  
}  
}'  
I get back only 10 results and they are random every time. However, the  
total hits remain 500. The hits array only contain 10 entries. Am I missing  
something?

Thanks.

--

---

<div class="post-metadata">

**Author:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [November 6, 2012, 7:26pm UTC](https://discuss.elastic.co/t/missing-results-from-es-when-using-simple-curl/9585/2 "2012-11-06T19:26:32Z")

</div>

Hello,

You can specify how many results you get back via "size":

> **[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.

Best regards,  
Radu  
On Nov 6, 2012 9:07 PM, "Dinesh Sriram" [dineshsriram1989@gmail.com](mailto:dineshsriram1989@gmail.com) wrote:

> I am trying out Elasticsearch for the first time. I just have 1 node and  
> 1 index.
> 
> curl -XPUT [http://localhost:9200/testing/dummy/1](http://localhost:9200/testing/dummy/1) -d '{  
> "snapshotTime" : "2012-10-31T13:31:21",  
> "ratio" : "50",  
> "description" : "sample description"
> 
> }'
> 
> I have indexed 500 such dummies to index 'testing'.  
> [http://localhost:9200/testing/dummy/1](http://localhost:9200/testing/dummy/1)  
> .  
> .  
> .  
> .  
> [http://localhost:9200/testing/dummy/500](http://localhost:9200/testing/dummy/500)
> 
> Now, when I tried a matchAll query with this data set,
> 
> curl -XGET '[http://localhost:9202/\_all/\_search?pretty=true](http://localhost:9202/_all/_search?pretty=true)' -d '  
> {  
> "query" : {  
> "matchAll" : {}  
> }  
> }'  
> I get back only 10 results and they are random every time. However, the  
> total hits remain 500. The hits array only contain 10 entries. Am I missing  
> something?
> 
> Thanks.
> 
> --

--

---

<div class="post-metadata">

**Author:** ![Dinesh\_Sriram](https://avatars.discourse-cdn.com/v4/letter/d/96bed5/32.png) [@Dinesh\_Sriram](https://discuss.elastic.co/u/Dinesh_Sriram)\
**Post date:** [November 6, 2012, 7:30pm UTC](https://discuss.elastic.co/t/missing-results-from-es-when-using-simple-curl/9585/3 "2012-11-06T19:30:20Z")

</div>

Thanks. Is there any maximum limit on the size?

On Tuesday, November 6, 2012 2:26:36 PM UTC-5, Radu Gheorghe wrote:

> Hello,
> 
> You can specify how many results you get back via "size":  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/from-size.html)
> 
> Best regards,  
> Radu  
> On Nov 6, 2012 9:07 PM, "Dinesh Sriram" \<[dineshsr...@gmail.com](mailto:dineshsr...@gmail.com)\<javascript:\>\>  
> wrote:
> 
> > I am trying out Elasticsearch for the first time. I just have 1 node and  
> > 1 index.
> > 
> > curl -XPUT [http://localhost:9200/testing/dummy/1](http://localhost:9200/testing/dummy/1) -d '{  
> > "snapshotTime" : "2012-10-31T13:31:21",  
> > "ratio" : "50",  
> > "description" : "sample description"
> > 
> > }'
> > 
> > I have indexed 500 such dummies to index 'testing'.  
> > [http://localhost:9200/testing/dummy/1](http://localhost:9200/testing/dummy/1)  
> > .  
> > .  
> > .  
> > .  
> > [http://localhost:9200/testing/dummy/500](http://localhost:9200/testing/dummy/500)
> > 
> > Now, when I tried a matchAll query with this data set,
> > 
> > curl -XGET '[http://localhost:9202/\_all/\_search?pretty=true](http://localhost:9202/_all/_search?pretty=true)' -d '  
> > {  
> > "query" : {  
> > "matchAll" : {}  
> > }  
> > }'  
> > I get back only 10 results and they are random every time. However, the  
> > total hits remain 500. The hits array only contain 10 entries. Am I missing  
> > something?
> > 
> > Thanks.
> > 
> > --

--

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 6, 2012, 10:59pm UTC](https://discuss.elastic.co/t/missing-results-from-es-when-using-simple-curl/9585/4 "2012-11-06T22:59:53Z")

</div>

If you need to export your results (for big sizes), you should look at the scan&scroll features.

> **[Elastic — The Search AI Company](https://www.elastic.co)**
>
> Power insights and outcomes with The Elastic Search AI Platform. See into your data and find answers that matter with enterprise solutions designed to help you accelerate time to insight. Try Elastic ...

> **[Elastic — The Search AI Company](https://www.elastic.co)**
>
> Power insights and outcomes with The Elastic Search AI Platform. See into your data and find answers that matter with enterprise solutions designed to help you accelerate time to insight. Try Elastic ...

## HTH

David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 6 nov. 2012 à 20:30, Dinesh Sriram [dineshsriram1989@gmail.com](mailto:dineshsriram1989@gmail.com) a écrit :

Thanks. Is there any maximum limit on the size?

On Tuesday, November 6, 2012 2:26:36 PM UTC-5, Radu Gheorghe wrote:

> Hello,
> 
> You can specify how many results you get back via "size":  
> [Elastic — The Search AI Company | Elastic](http://www.elasticsearch.org/guide/reference/api/search/from-size.html)
> 
> Best regards,  
> Radu
> 
> On Nov 6, 2012 9:07 PM, "Dinesh Sriram" [dineshsr...@gmail.com](mailto:dineshsr...@gmail.com) wrote:
> 
> > I am trying out Elasticsearch for the first time. I just have 1 node and 1 index.
> > 
> > curl -XPUT [http://localhost:9200/testing/dummy/1](http://localhost:9200/testing/dummy/1) -d '{  
> > "snapshotTime" : "2012-10-31T13:31:21",  
> > "ratio" : "50",  
> > "description" : "sample description"
> > 
> > }'
> > 
> > I have indexed 500 such dummies to index 'testing'.  
> > [http://localhost:9200/testing/dummy/1](http://localhost:9200/testing/dummy/1)  
> > .  
> > .  
> > .  
> > .  
> > [http://localhost:9200/testing/dummy/500](http://localhost:9200/testing/dummy/500)
> > 
> > Now, when I tried a matchAll query with this data set,
> > 
> > curl -XGET '[http://localhost:9202/\_all/\_search?pretty=true](http://localhost:9202/_all/_search?pretty=true)' -d '  
> > {  
> > "query" : {  
> > "matchAll" : {}  
> > }  
> > }'  
> > I get back only 10 results and they are random every time. However, the total hits remain 500. The hits array only contain 10 entries. Am I missing something?
> > 
> > ## Thanks.

--

--

---

<div class="post-metadata">

**Author:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [November 7, 2012, 7:44am UTC](https://discuss.elastic.co/t/missing-results-from-es-when-using-simple-curl/9585/5 "2012-11-07T07:44:54Z")

</div>

Hello Dinesh,

I'm not sure, but I think it's MAX\_INT-1 or something like that. But  
if you want to go through a lot of results, you almost certainly would  
be better off if you set your type of search to scan[0] and then  
scroll[1] through the results.

That said, the scan type doesn't support sorting[2].

## Best regards, Radu

[http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

[0] [Elastic — The Search AI Company | Elastic](http://www.elasticsearch.org/guide/reference/api/search/search-type.html)  
[1] [Elastic — The Search AI Company | Elastic](http://www.elasticsearch.org/guide/reference/api/search/scroll.html)  
[2] [Elastic — The Search AI Company | Elastic](http://www.elasticsearch.org/guide/reference/api/search/sort.html)

On Tue, Nov 6, 2012 at 9:30 PM, Dinesh Sriram  
[dineshsriram1989@gmail.com](mailto:dineshsriram1989@gmail.com) wrote:

> Thanks. Is there any maximum limit on the size?
> 
> On Tuesday, November 6, 2012 2:26:36 PM UTC-5, Radu Gheorghe wrote:
> 
> > Hello,
> > 
> > You can specify how many results you get back via "size":  
> > [Elastic — The Search AI Company | Elastic](http://www.elasticsearch.org/guide/reference/api/search/from-size.html)
> > 
> > Best regards,  
> > Radu
> > 
> > On Nov 6, 2012 9:07 PM, "Dinesh Sriram" [dineshsr...@gmail.com](mailto:dineshsr...@gmail.com) wrote:
> > 
> > > I am trying out Elasticsearch for the first time. I just have 1 node and  
> > > 1 index.
> > > 
> > > curl -XPUT [http://localhost:9200/testing/dummy/1](http://localhost:9200/testing/dummy/1) -d '{  
> > > "snapshotTime" : "2012-10-31T13:31:21",  
> > > "ratio" : "50",  
> > > "description" : "sample description"
> > > 
> > > }'
> > > 
> > > I have indexed 500 such dummies to index 'testing'.  
> > > [http://localhost:9200/testing/dummy/1](http://localhost:9200/testing/dummy/1)  
> > > .  
> > > .  
> > > .  
> > > .  
> > > [http://localhost:9200/testing/dummy/500](http://localhost:9200/testing/dummy/500)
> > > 
> > > Now, when I tried a matchAll query with this data set,
> > > 
> > > curl -XGET '[http://localhost:9202/\_all/\_search?pretty=true](http://localhost:9202/_all/_search?pretty=true)' -d '  
> > > {  
> > > "query" : {  
> > > "matchAll" : {}  
> > > }  
> > > }'  
> > > I get back only 10 results and they are random every time. However, the  
> > > total hits remain 500. The hits array only contain 10 entries. Am I missing  
> > > something?
> > > 
> > > Thanks.
> > > 
> > > --
> 
> --

--

---

<div class="post-metadata">

**Author:** ![Dinesh\_Sriram](https://avatars.discourse-cdn.com/v4/letter/d/96bed5/32.png) [@Dinesh\_Sriram](https://discuss.elastic.co/u/Dinesh_Sriram)\
**Post date:** [November 7, 2012, 2:14pm UTC](https://discuss.elastic.co/t/missing-results-from-es-when-using-simple-curl/9585/6 "2012-11-07T14:14:53Z")

</div>

Thank you David and Radu. I will look into that.

On Wednesday, November 7, 2012 2:44:57 AM UTC-5, Radu Gheorghe wrote:

> Hello Dinesh,
> 
> I'm not sure, but I think it's MAX\_INT-1 or something like that. But  
> if you want to go through a lot of results, you almost certainly would  
> be better off if you set your type of search to scan[0] and then  
> scroll[1] through the results.
> 
> That said, the scan type doesn't support sorting[2].
> 
> ## Best regards, Radu
> 
> [http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene
> 
> [0]  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/search-type.html)  
> [1] [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/scroll.html)  
> [2] [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/sort.html)
> 
> On Tue, Nov 6, 2012 at 9:30 PM, Dinesh Sriram  
> \<[dineshsr...@gmail.com](mailto:dineshsr...@gmail.com) \<javascript:\>\> wrote:
> 
> > Thanks. Is there any maximum limit on the size?
> > 
> > On Tuesday, November 6, 2012 2:26:36 PM UTC-5, Radu Gheorghe wrote:
> > 
> > > Hello,
> > > 
> > > You can specify how many results you get back via "size":  
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/from-size.html)
> > > 
> > > Best regards,  
> > > Radu
> > > 
> > > On Nov 6, 2012 9:07 PM, "Dinesh Sriram" [dineshsr...@gmail.com](mailto:dineshsr...@gmail.com) wrote:
> > > 
> > > > I am trying out Elasticsearch for the first time. I just have 1 node  
> > > > and  
> > > > 1 index.
> > > > 
> > > > curl -XPUT [http://localhost:9200/testing/dummy/1](http://localhost:9200/testing/dummy/1) -d '{  
> > > > "snapshotTime" : "2012-10-31T13:31:21",  
> > > > "ratio" : "50",  
> > > > "description" : "sample description"
> > > > 
> > > > }'
> > > > 
> > > > I have indexed 500 such dummies to index 'testing'.  
> > > > [http://localhost:9200/testing/dummy/1](http://localhost:9200/testing/dummy/1)  
> > > > .  
> > > > .  
> > > > .  
> > > > .  
> > > > [http://localhost:9200/testing/dummy/500](http://localhost:9200/testing/dummy/500)
> > > > 
> > > > Now, when I tried a matchAll query with this data set,
> > > > 
> > > > curl -XGET '[http://localhost:9202/\_all/\_search?pretty=true](http://localhost:9202/_all/_search?pretty=true)' -d '  
> > > > {  
> > > > "query" : {  
> > > > "matchAll" : {}  
> > > > }  
> > > > }'  
> > > > I get back only 10 results and they are random every time. However,  
> > > > the  
> > > > total hits remain 500. The hits array only contain 10 entries. Am I  
> > > > missing  
> > > > something?
> > > > 
> > > > Thanks.
> > > > 
> > > > --
> > 
> > --

--

---

<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, 3:05am UTC](https://discuss.elastic.co/t/missing-results-from-es-when-using-simple-curl/9585/7 "2017-07-06T03:05:44Z")

</div>


