How to return more than 10k hits in spring boot without changing the index.max_result_window from elasticsearch 8.6

Hello ! I want to return all the documents matching my query but the limit is set to 10k ? What can I do to return all the documents ( they are so much higher than 10k documents) without changing the index.max_result_window. As I read in the documentation, I should use the search_after parameter but I didn't know how to implement it .
I am using elasticsearch 8.6 and a Low Level REST Client

SearchResponse<Example> response =client.search(s -> s
					.index("index-name")
					.query(q->q
							.match(t -> t
									.field("field")
									.query("something"))).size(10000),
					Example.class);
List<Hit<Example>> hits = response.hits().hits();

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