Hisoka-X commented on code in PR #8895:
URL: https://github.com/apache/seatunnel/pull/8895#discussion_r1986528966
##########
seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/source/ElasticsearchSourceReader.java:
##########
@@ -74,22 +79,11 @@ public void pollNext(Collector<SeaTunnelRow> output) throws
Exception {
ElasticsearchSourceSplit split = splits.poll();
if (split != null) {
SeaTunnelRowType seaTunnelRowType =
split.getSeaTunnelRowType();
- SeaTunnelRowDeserializer deserializer =
- new DefaultSeaTunnelRowDeserializer(seaTunnelRowType);
ElasticsearchConfig sourceIndexInfo =
split.getElasticsearchConfig();
- ScrollResult scrollResult =
- esRestClient.searchByScroll(
- sourceIndexInfo.getIndex(),
- sourceIndexInfo.getSource(),
- sourceIndexInfo.getQuery(),
- sourceIndexInfo.getScrollTime(),
- sourceIndexInfo.getScrollSize());
- outputFromScrollResult(scrollResult, sourceIndexInfo, output,
deserializer);
- while (scrollResult.getDocs() != null &&
scrollResult.getDocs().size() > 0) {
- scrollResult =
- esRestClient.searchWithScrollId(
- scrollResult.getScrollId(),
sourceIndexInfo.getScrollTime());
- outputFromScrollResult(scrollResult, sourceIndexInfo,
output, deserializer);
+ if
(SQL_TYPE.equalsIgnoreCase(sourceIndexInfo.getSearchType())) {
+ cursorSearchResult(seaTunnelRowType, sourceIndexInfo,
output);
+ } else {
+ scrollSearchResult(seaTunnelRowType, sourceIndexInfo,
output);
Review Comment:
@CosmosNi
--
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]