From 62fad3b1885cbb401926ad659aba0279caf61b1f Mon Sep 17 00:00:00 2001 From: Bryan McLellan Date: Wed, 3 May 2017 16:15:25 -0400 Subject: [PATCH] Reduce the search response limit from 100k to 10k The default index.max_result_window for Elasticsearch is 10k. This leads to errors like: 2017-05-03_19:36:41.82788 Caused by: QueryPhaseExecutionException[Result window is too large, from + size must be less than or equal to: [10000] but was [100000]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index level parameter.] Signed-off-by: Bryan McLellan --- lib/chef-vault/item.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/chef-vault/item.rb b/lib/chef-vault/item.rb index 1312718..dad6b49 100644 --- a/lib/chef-vault/item.rb +++ b/lib/chef-vault/item.rb @@ -103,7 +103,7 @@ def search_results(statement = search) results_returned = false results = [] query = Chef::Search::Query.new - query.search(:node, statement, filter_result: { name: ["name"] }, rows: 100000) do |node| + query.search(:node, statement, filter_result: { name: ["name"] }, rows: 10000) do |node| results_returned = true results << node["name"] end