summaryrefslogtreecommitdiff
path: root/core/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java
diff options
context:
space:
mode:
authorSimon Willnauer <simonw@apache.org>2017-02-21 18:36:59 +0100
committerGitHub <noreply@github.com>2017-02-21 18:36:59 +0100
commitce625ebdccc35639d7423ad6309119422c99ccf3 (patch)
tree6478473e104dcc0e08278ef95f861aa2cef2f540 /core/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java
parent1ba9770037c29c41cd6ee306957842e00489c320 (diff)
Expose `batched_reduce_size` via `_search` (#23288)
In #23253 we added an the ability to incrementally reduce search results. This change exposes the parameter to control the batch since and therefore the memory consumption of a large search request.
Diffstat (limited to 'core/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java')
-rw-r--r--core/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java b/core/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java
index bf8308202b..89e2f23861 100644
--- a/core/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java
+++ b/core/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java
@@ -20,7 +20,6 @@
package org.elasticsearch.rest.action.search;
import org.elasticsearch.action.search.SearchRequest;
-import org.elasticsearch.action.search.SearchType;
import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings;
@@ -94,6 +93,9 @@ public class RestSearchAction extends BaseRestHandler {
searchRequest.source().parseXContent(context);
}
+ final int batchedReduceSize = request.paramAsInt("batched_reduce_size", searchRequest.getBatchedReduceSize());
+ searchRequest.setBatchedReduceSize(batchedReduceSize);
+
// do not allow 'query_and_fetch' or 'dfs_query_and_fetch' search types
// from the REST layer. these modes are an internal optimization and should
// not be specified explicitly by the user.