ES Query RemoteTransportException, QueryPhaseExecutionException

When running a query is ES, I try to get results > 10000 and I get RemoteTransportException nested; QueryPhaseExecutionException[Result window is too large, from + size must be less than or equal to: [10000] but was [10001].
My query is setup for paging so that I bring back 100 results per page. But when I get > 10000 I get this error.
I am doing all this in Java

Any ideas ?

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 but you shouldn't make it massive. This is one of the things Elasticsearch added in 2.x to guard against running itself out of memory.

How can I use the scroll API with paging ? If I want to bring back 1000 results per page