CosmosNi commented on code in PR #6425:
URL: https://github.com/apache/seatunnel/pull/6425#discussion_r1560566444


##########
seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/client/EsRestClient.java:
##########
@@ -289,6 +289,25 @@ public ScrollResult searchByScroll(
         return getDocsFromScrollRequest(endpoint, 
JsonUtils.toJsonString(param));
     }
 
+    /**
+     * first time to request search documents by scroll call 
/${index}/_search?scroll=${scroll}
+     *
+     * @param index index name
+     * @param scrollTime such as:1m
+     * @param scrollSize fetch documents count in one request
+     */
+    public ScrollResult searchByScroll(
+            String index, Map<String, Object> query, String scrollTime, int 
scrollSize) {
+        Map<String, Object> param = new HashMap<>();
+        param.put("query", query);
+        param.put("sort", new String[] {"_doc"});
+        param.put("size", scrollSize);
+        String endpoint = "/" + index + "/_search?scroll=" + scrollTime;
+        ScrollResult scrollResult =
+                getDocsFromScrollRequest(endpoint, 
JsonUtils.toJsonString(param));
+        return scrollResult;
+    }
+

Review Comment:
   已经删除



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to