private void searchData(SearchSourceBuilder searchSourceBuilder, Map<String, List<Map<String, Object>>> tmpCache) {

        Object[] searchAfterParameter = null;
        SearchResponse searchResponse = null;
        SearchHit[] searchHits = null;

        while (true) {
            try {
                if (searchAfterParameter != null) {
                    // set search mark
                    searchSourceBuilder.searchAfter(searchAfterParameter);
                }

                searchRequest.source(searchSourceBuilder);
                searchResponse = rhlClient.search(searchRequest, RequestOptions.DEFAULT);
                searchHits = searchResponse.getHits().getHits();
                loadToCache(searchHits, tmpCache);

                if (searchHits.length < getFetchSize()) {
                    break;
                }

                searchAfterParameter = searchHits[searchHits.length - 1].getSortValues();
            } catch (IOException e) {
                LOG.error("Query failed!", e);
            }
        }
    }
@description:
@program: flink.sql
@author: lany
@create: 2021/01/11 14:53
elasticsearch7/elasticsearch7-side/elasticsearch7-all-side/src/main/java/com/dtstack/flink/sql/side/elasticsearch7/Elasticsearch7AllReqRow.java