Skip to content

Commit adbbc79

Browse files
committed
remove hardcode limit
Signed-off-by: Lantao Jin <ltjin@amazon.com>
1 parent aed63f7 commit adbbc79

2 files changed

Lines changed: 2 additions & 12 deletions

File tree

docs/user/ppl/cmd/mvcombine.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ mvcombine <field>
2929

3030
## Configuration
3131

32-
The mvcombine command leverages OpenSearch's top hits aggregation pushdown, which requires increasing the `index.max_inner_result_window` setting to 10000 or larger.
32+
The mvcombine command leverages OpenSearch's top hits aggregation pushdown, which requires increasing the index setting `index.max_inner_result_window` to `plugins.query.buckets` (default: 10000) or larger.
3333

3434
Change the `index.max_inner_result_window` to `10000`:
3535

opensearch/src/main/java/org/opensearch/sql/opensearch/request/AggregateAnalyzer.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ public class AggregateAnalyzer {
112112
/** metadata field used when there is no argument. Only apply to COUNT. */
113113
private static final String METADATA_FIELD = "_index";
114114

115-
private static final int MAX_TOP_HITS_RESULT_WINDOW = 10000;
116-
117115
/** Internal exception. */
118116
@SuppressWarnings("serial")
119117
public static final class AggregateAnalyzerException extends RuntimeException {
@@ -608,15 +606,7 @@ yield switch (functionName) {
608606
case COLLECT, ARRAY_AGG -> {
609607
TopHitsAggregationBuilder topHitsBuilder =
610608
createTopHitsBuilder(
611-
aggCall,
612-
args,
613-
aggName,
614-
helper,
615-
MAX_TOP_HITS_RESULT_WINDOW,
616-
false,
617-
false,
618-
null,
619-
null);
609+
aggCall, args, aggName, helper, helper.queryBucketSize, false, false, null, null);
620610
yield Pair.of(topHitsBuilder, new TopHitsParser(aggName, false, true));
621611
}
622612
default ->

0 commit comments

Comments
 (0)