# Search all docs into index in nest 2.1.1

**URL:** <https://discuss.elastic.co/t/search-all-docs-into-index-in-nest-2-1-1/47370>\
**Category:** Elasticsearch\
**Created:** [April 14, 2016, 10:18am UTC](https://discuss.elastic.co/t/search-all-docs-into-index-in-nest-2-1-1/47370 "2016-04-14T10:18:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![fabriziodb](https://avatars.discourse-cdn.com/v4/letter/f/7993a0/32.png) [@fabriziodb](https://discuss.elastic.co/u/fabriziodb)\
**Post date:** [April 14, 2016, 10:18am UTC](https://discuss.elastic.co/t/search-all-docs-into-index-in-nest-2-1-1/47370/1 "2016-04-14T10:18:52Z")

</div>

hi, this code returns only 10 docs

ISearchResponse result = elasticClient.Search  
(  
x =\> x.MatchAll()  
);

this one throw exception 500

ISearchResponse result = elasticClient.Search  
(  
x =\> x.MatchAll().From(0).Size(int.MaxValue)  
);

Thanks.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [April 14, 2016, 1:06pm UTC](https://discuss.elastic.co/t/search-all-docs-into-index-in-nest-2-1-1/47370/2 "2016-04-14T13:06:51Z")

</div>

Hey,

can you show us the exception in the elasticsearch logs or error message returned by elasticsearch? A 500 error usually indicates that elasticsearch threw an exception.

--Alex

---

<div class="post-metadata">

**Author:** ![fabriziodb](https://avatars.discourse-cdn.com/v4/letter/f/7993a0/32.png) [@fabriziodb](https://discuss.elastic.co/u/fabriziodb)\
**Post date:** [April 14, 2016, 1:36pm UTC](https://discuss.elastic.co/t/search-all-docs-into-index-in-nest-2-1-1/47370/3 "2016-04-14T13:36:35Z")

</div>

this is the result.ApiCall.ToString()

{Unsuccessful low level call on POST: /push\_analizer\_ita/doc/\_search}  
[Elasticsearch.Net.ElasticsearchResponse\<Nest.SearchResponse\<TestIndiciFisco.Doc\>\>]: {Unsuccessful low level call on POST: /push\_analizer\_ita/doc/\_search}  
AuditTrail: Count = 2  
DebugInformation: "Unsuccessful low level call on POST: /push\_analizer\_ita/doc/\_search\r\n# Audit trail of this API call:\r\n - PingSuccess: Node: [http://x.x.x.x:9201/](http://x.x.x.x:9201/) Took: 00:00:01.2160000\r\n - BadResponse: Node: [http://x.x.x.x:9201/](http://x.x.x.x:9201/) Took: 00:00:08.5010000\r\n# ServerError: ServerError: 500Type: search\_phase\_execution\_exception Reason: "all shards failed"\r\n# OriginalException: System.Net.WebException: Errore del server remoto: (500) Errore interno del server.\r\n in System.Net.HttpWebRequest.GetResponse()\r\n in Elasticsearch.Net.HttpConnection.Request[TReturn](RequestData requestData)\r\n# Request:\r\n\<Request stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.\>\r\n# Response:\r\n\<Response stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.\>\r\n"  
HttpMethod: POST  
HttpStatusCode: 500  
OriginalException: {"Errore del server remoto: (500) Errore interno del server."}  
RequestBodyInBytes: null  
ResponseBodyInBytes: null  
ServerError: {ServerError: 500Type: search\_phase\_execution\_exception Reason: "all shards failed"}  
Success: false  
Uri: {[http://x.x.x.x:9201/push\_analizer\_ita/doc/\_search](http://x.x.x.x:9201/push_analizer_ita/doc/_search)}

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [April 14, 2016, 1:54pm UTC](https://discuss.elastic.co/t/search-all-docs-into-index-in-nest-2-1-1/47370/4 "2016-04-14T13:54:17Z")

</div>

Hey,

so this means that a regular `/_search` operation against Elasticsearch should also fail? You can try using curl or a browser. If so, you should check your elasticsearch log files, whats up.

This is not a nest issue.

--Alex

---

<div class="post-metadata">

**Author:** ![fabriziodb](https://avatars.discourse-cdn.com/v4/letter/f/7993a0/32.png) [@fabriziodb](https://discuss.elastic.co/u/fabriziodb)\
**Post date:** [April 14, 2016, 2:51pm UTC](https://discuss.elastic.co/t/search-all-docs-into-index-in-nest-2-1-1/47370/5 "2016-04-14T14:51:23Z")

</div>

i found the problem using fiddler.

post:  
[http://x.x.x.x:9201/push\_analizer\_ita/doc/\_search](http://x.x.x.x:9201/push_analizer_ita/doc/_search)

response:  
{"error":{"root\_cause":[{"type":"query\_phase\_execution\_exception","reason":"Result window is too large, from + size must be less than or equal to: [10000] but was [2147483647]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max\_result\_window] index level parameter."}],"type":"search\_phase\_execution\_exception","reason":"all shards failed","phase":"query","grouped":true,"failed\_shards":[{"shard":0,"index":"push\_analizer\_ita","node":"XKuEFgr8REekdDx6s9n0qQ","reason":{"type":"query\_phase\_execution\_exception","reason":"Result window is too large, from + size must be less than or equal to: [10000] but was [2147483647]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max\_result\_window] index level parameter."}}]},"status":500}

---

<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 5, 2017, 10:59pm UTC](https://discuss.elastic.co/t/search-all-docs-into-index-in-nest-2-1-1/47370/6 "2017-07-05T22:59:10Z")

</div>


