Commit 074bc6a 1 parent 79b1b74 commit 074bc6a Copy full SHA for 074bc6a
File tree 1 file changed +3
-2
lines changed
server/src/main/java/org/opensearch/search/internal
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 35
35
import org .apache .lucene .search .CollectorManager ;
36
36
import org .apache .lucene .search .FieldDoc ;
37
37
import org .apache .lucene .search .Query ;
38
- import org .apache .lucene .util .ArrayUtil ;
39
38
import org .opensearch .action .search .SearchShardTask ;
40
39
import org .opensearch .action .search .SearchType ;
41
40
import org .opensearch .common .Nullable ;
87
86
import java .util .concurrent .CopyOnWriteArrayList ;
88
87
import java .util .concurrent .atomic .AtomicBoolean ;
89
88
89
+ import static org .opensearch .search .aggregations .bucket .BucketUtils .suggestShardSideQueueSize ;
90
+
90
91
/**
91
92
* This class encapsulates the state needed to execute a search. It holds a reference to the
92
93
* shards point in time snapshot (IndexReader / ContextIndexSearcher) and allows passing on
@@ -410,7 +411,7 @@ public boolean shouldUseConcurrentSearch() {
410
411
*/
411
412
public LocalBucketCountThresholds asLocalBucketCountThresholds (TermsAggregator .BucketCountThresholds bucketCountThresholds ) {
412
413
if (shouldUseConcurrentSearch ()) {
413
- return new LocalBucketCountThresholds (0 , ArrayUtil . MAX_ARRAY_LENGTH - 1 );
414
+ return new LocalBucketCountThresholds (0 , suggestShardSideQueueSize ( bucketCountThresholds . getShardSize ()) );
414
415
} else {
415
416
return new LocalBucketCountThresholds (bucketCountThresholds .getShardMinDocCount (), bucketCountThresholds .getShardSize ());
416
417
}
You can’t perform that action at this time.
0 commit comments