diff --git a/docs/changelog/116541.yaml b/docs/changelog/116541.yaml new file mode 100644 index 0000000000000..18509a02e20f1 --- /dev/null +++ b/docs/changelog/116541.yaml @@ -0,0 +1,5 @@ +pr: 116541 +summary: Update `index.max_result_window` error to point to `search_after` not scroll +area: Search +type: enhancement +issues: [] diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/30_limits.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/30_limits.yml index f14614a820176..205019d2bbdae 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/30_limits.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/30_limits.yml @@ -19,7 +19,7 @@ setup: --- "Request window limits without scroll": - do: - catch: /Result window is too large, from \+ size must be less than or equal to[:] \[10000\] but was \[10010\]\. See the scroll api for a more efficient way to request large data sets\./ + catch: /Result window is too large, from \+ size must be less than or equal to[:] \[10000\] but was \[10010\]\. See search after for a more efficient way to request large data sets\./ search: rest_total_hits_as_int: true index: test_1 diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/simple/SimpleSearchIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/simple/SimpleSearchIT.java index e87c4790aa665..22c17bec1e94a 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/simple/SimpleSearchIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/simple/SimpleSearchIT.java @@ -571,7 +571,7 @@ private void assertWindowFails(SearchRequestBuilder search) { + IndexSettings.MAX_RESULT_WINDOW_SETTING.get(Settings.EMPTY) ) ); - assertThat(e.toString(), containsString("See the scroll api for a more efficient way to request large data sets")); + assertThat(e.toString(), containsString("See search after for a more efficient way to request large data sets")); } private void assertRescoreWindowFails(int windowSize) { diff --git a/server/src/main/java/org/elasticsearch/search/DefaultSearchContext.java b/server/src/main/java/org/elasticsearch/search/DefaultSearchContext.java index 8ac35f7c40caa..33b4e31ba2534 100644 --- a/server/src/main/java/org/elasticsearch/search/DefaultSearchContext.java +++ b/server/src/main/java/org/elasticsearch/search/DefaultSearchContext.java @@ -360,7 +360,7 @@ public void preProcess() { + maxResultWindow + "] but was [" + resultWindow - + "]. See the scroll api for a more efficient way to request large data sets. " + + "]. See search after for a more efficient way to request large data sets. " + "This limit can be set by changing the [" + IndexSettings.MAX_RESULT_WINDOW_SETTING.getKey() + "] index level setting." diff --git a/server/src/test/java/org/elasticsearch/search/DefaultSearchContextTests.java b/server/src/test/java/org/elasticsearch/search/DefaultSearchContextTests.java index a474c1dc38c50..d34f3382b5fa4 100644 --- a/server/src/test/java/org/elasticsearch/search/DefaultSearchContextTests.java +++ b/server/src/test/java/org/elasticsearch/search/DefaultSearchContextTests.java @@ -196,7 +196,7 @@ protected Engine.Searcher acquireSearcherInternal(String source) { "Result window is too large, from + size must be less than or equal to:" + " [" + maxResultWindow - + "] but was [310]. See the scroll api for a more efficient way to request large data sets. " + + "] but was [310]. See search after for a more efficient way to request large data sets. " + "This limit can be set by changing the [" + IndexSettings.MAX_RESULT_WINDOW_SETTING.getKey() + "] index level setting."