Hi,
I had billions of document in an index. I read half of them with java-high-level-client until my code got an exception. so I need to skip these documents. I found search_after as a solution but I have no idea how it is working on the match-all query and without sorting.
here is the simplified version of my search request :
SearchRequest searchRequest = new SearchRequest("Index");
searchRequest.types("type");
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
searchSourceBuilder.query(QueryBuilders.matchAllQuery());
searchSourceBuilder.size(5000);
// searchSourceBuilder.searchAfter() // need to skip x documents or a given uid
searchRequest.source(searchSourceBuilder);
sourceBuilder.timeout(new TimeValue(10, TimeUnit.MINUTES));
searchRequest.scroll(new TimeValue(10, TimeUnit.MINUTES));
SearchResponse searchResponse = highLevelClient.search(searchRequest);
....
Thank you so much
I didn't sort the match all query before and my code did its work on the billions document. so I start the project again with scroll API (read and skip 1 million document per minute on my VPS ).
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.