Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search After - Scroll problem. #104

Open
matheussl22 opened this issue Jan 22, 2019 · 2 comments
Open

Search After - Scroll problem. #104

matheussl22 opened this issue Jan 22, 2019 · 2 comments

Comments

@matheussl22
Copy link

matheussl22 commented Jan 22, 2019

I have been problem with the uso of scroll.
"Result window is too large, from + size must be less than or equal to: [10000] but was [10020]"

I need use "Search After" to fix, but I not found on Jest.
https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-request-search-after.html

Any help to fix?

More reference about problem:
https://stackoverflow.com/questions/42972508/how-to-get-more-than-10-thousand-documents-at-a-time-from-elasticsearch-using-je
https://stackoverflow.com/questions/35206409/elasticsearch-2-1-result-window-is-too-large-index-max-result-window

@VanRoy
Copy link
Owner

VanRoy commented Feb 14, 2019

Hi @matheussl22 , I think that searchAfter is usable with Jest. I will check how we can integrate it.

@VanRoy VanRoy added this to the 3.3.2.RELEASE milestone May 9, 2020
@VanRoy VanRoy modified the milestones: 3.3.2.RELEASE, 4.0.0.RELEASE Sep 12, 2020
@leslielililee
Copy link

SearchRequest searchRequest = new SearchRequest(INDEX_NAME);
SearchSourceBuilder source = searchRequest.source();
source.query(QueryBuilders.termQuery("condition","1"));
source.sort("condition",SortOrder.DESC);
source.searchAfter(new Object[]{id});
source.from(0);
source.size(size);
SearchResponse search = restHighLevelClient.search(searchRequest, RequestOptions.DEFAULT);
org.elasticsearch.search.SearchHits hits = search.getHits();
List<Map<String, Object>> collect = Arrays.stream(hits.getHits()).map(temp -> temp.getSourceAsMap()).collect(Collectors.toList());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants