You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2023/01/23 04:11:52 UTC

[doris] 03/11: [fix](DOE) only return first batch data in ES 8.x (#16025)

This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 1db3e975cda4bb9f9a33277457f422ad417eb303
Author: qiye <ji...@gmail.com>
AuthorDate: Wed Jan 18 09:28:34 2023 +0800

    [fix](DOE) only return first batch data in ES 8.x (#16025)
    
    Do not use terminate_after and size together in scroll request of ES 8.x.
---
 be/src/exec/es/es_scan_reader.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/be/src/exec/es/es_scan_reader.cpp b/be/src/exec/es/es_scan_reader.cpp
index 8470350dd0..fab99c85ec 100644
--- a/be/src/exec/es/es_scan_reader.cpp
+++ b/be/src/exec/es/es_scan_reader.cpp
@@ -76,8 +76,8 @@ ESScanReader::ESScanReader(const std::string& target,
         std::stringstream scratch;
         // just send a normal search  against the elasticsearch with additional terminate_after param to achieve terminate early effect when limit take effect
         if (_type.empty()) {
+            // `terminate_after` and `size` can not be used together in scroll request of ES 8.x
             scratch << _target << REQUEST_SEPARATOR << _index << "/_search?"
-                    << "terminate_after=" << props.at(KEY_TERMINATE_AFTER)
                     << REQUEST_PREFERENCE_PREFIX << _shards << "&" << filter_path;
         } else {
             scratch << _target << REQUEST_SEPARATOR << _index << REQUEST_SEPARATOR << _type
@@ -92,9 +92,10 @@ ESScanReader::ESScanReader(const std::string& target,
         // scroll request for scanning
         // add terminate_after for the first scroll to avoid decompress all postings list
         if (_type.empty()) {
+            // `terminate_after` and `size` can not be used together in scroll request of ES 8.x
             scratch << _target << REQUEST_SEPARATOR << _index << "/_search?"
                     << "scroll=" << _scroll_keep_alive << REQUEST_PREFERENCE_PREFIX << _shards
-                    << "&" << filter_path << "&terminate_after=" << batch_size_str;
+                    << "&" << filter_path;
         } else {
             scratch << _target << REQUEST_SEPARATOR << _index << REQUEST_SEPARATOR << _type
                     << "/_search?"


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org