Batch size is too large, size must be less than or equal to: [10000] but was [10001]. Scroll batch sizes cost as much memory as result windows so they are controlled by the [index.max_result_window] index level setting

Hello,

I'm using Elasticsearch 5.1.1 and Nest 5.0 and I'm trying to search items by query.
This is the code:
var searchDescriptor = new SearchDescriptor()
.Index(indexName)
.Size(itemsPerShard)
.StoredFields((Field)"Id")
.Scroll("1m")
.Sort(ss => ss.Ascending(SortSpecialField.DocumentIndexOrder))
.Query(qd => qd
.QueryString(snd => snd
.Query(deleteByQuery)
.DefaultOperator(Operator.And))
);
var scanResults = client.Search(s => searchDescriptor);

When itemsPerShard > 10.000, I receive this error:
{Invalid NEST response built from a unsuccessful low level call on POST: /index/_search?scroll=1m}.
And in elasticsearch log file:
Batch size is too large, size must be less than or equal to: [10000] but was [10001]. Scroll batch sizes cost as much memory as result windows so they are controlled by the [index.max_result_window] index level setting.

How can I resolve this issue?

Thank you!

Why do you want the number of items per shard to be larger than 10000?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.