Skip to content

Commit 81da10f

Browse files
authored
Increase search.max_bucket by one (#70645) (#70706)
1 parent 3871fae commit 81da10f

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

docs/reference/aggregations/bucket.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ define fixed number of multiple buckets, and others dynamically create the bucke
1515

1616
NOTE: The maximum number of buckets allowed in a single response is limited by a
1717
dynamic cluster setting named
18-
<<search-settings-max-buckets,`search.max_buckets`>>. It defaults to 65,535.
18+
<<search-settings-max-buckets,`search.max_buckets`>>. It defaults to 65,536.
1919
Requests that try to return more than the limit will fail with an exception.
2020

2121
include::bucket/adjacency-matrix-aggregation.asciidoc[]

server/src/main/java/org/elasticsearch/search/aggregations/MultiBucketConsumerService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
* An aggregation service that creates instances of {@link MultiBucketConsumer}.
2525
* The consumer is used by {@link BucketsAggregator} and {@link InternalMultiBucketAggregation} to limit the number of buckets created
2626
* in {@link Aggregator#buildAggregations} and {@link InternalAggregation#reduce}.
27-
* The limit can be set by changing the `search.max_buckets` cluster setting and defaults to 65535.
27+
* The limit can be set by changing the `search.max_buckets` cluster setting and defaults to 65536.
2828
*/
2929
public class MultiBucketConsumerService {
30-
public static final int DEFAULT_MAX_BUCKETS = 65535;
30+
public static final int DEFAULT_MAX_BUCKETS = 65536;
3131
public static final Setting<Integer> MAX_BUCKET_SETTING =
3232
Setting.intSetting("search.max_buckets", DEFAULT_MAX_BUCKETS, 0, Setting.Property.NodeScope, Setting.Property.Dynamic);
3333

x-pack/plugin/sql/qa/jdbc/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/JdbcErrorsTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public void testHardLimitForSortOnAggregate() throws IOException, SQLException {
138138
SQLException.class,
139139
() -> c.prepareStatement("SELECT max(a) max FROM test GROUP BY b ORDER BY max LIMIT 120000").executeQuery()
140140
);
141-
assertEquals("The maximum LIMIT for aggregate sorting is [65535], received [120000]", e.getMessage());
141+
assertEquals("The maximum LIMIT for aggregate sorting is [65536], received [120000]", e.getMessage());
142142
}
143143
}
144144
}

x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/cli/ErrorsTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public void testHardLimitForSortOnAggregate() throws Exception {
120120
index("test", body -> body.field("a", 1).field("b", 2));
121121
String commandResult = command("SELECT max(a) max FROM test GROUP BY b ORDER BY max LIMIT 120000");
122122
assertEquals(
123-
START + "Bad request [[3;33;22mThe maximum LIMIT for aggregate sorting is [65535], received [120000]" + END,
123+
START + "Bad request [[3;33;22mThe maximum LIMIT for aggregate sorting is [65536], received [120000]" + END,
124124
commandResult
125125
);
126126
}

x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/rest/RestSqlTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ public void testHardLimitForSortOnAggregate() throws Exception {
485485
index("{\"a\": 1, \"b\": 2}");
486486
expectBadRequest(
487487
() -> runSql(randomMode(), "SELECT max(a) max FROM test GROUP BY b ORDER BY max LIMIT 120000"),
488-
containsString("The maximum LIMIT for aggregate sorting is [65535], received [120000]")
488+
containsString("The maximum LIMIT for aggregate sorting is [65536], received [120000]")
489489
);
490490
}
491491

0 commit comments

Comments
 (0)