Skip to content

Commit

Permalink
SOLR-17447 : Support for maxHitsPerShard.
Browse files Browse the repository at this point in the history
rename parameter to maxHits
  • Loading branch information
Siju Varghese committed Jan 10, 2025
1 parent b75efa0 commit 9653d00
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,7 @@ public Object reduce(Collection collectors) throws IOException {
var4.hasNext();
maxScore = Math.max(maxScore, collector.getMaxScore())) {
Collector next = (Collector) var4.next();
if (next instanceof EarlyTerminatingCollector) {
EarlyTerminatingCollector earlyTerminatingCollector = (EarlyTerminatingCollector) next;
if (next instanceof final EarlyTerminatingCollector earlyTerminatingCollector) {
next = earlyTerminatingCollector.getDelegate();
}
collector = (MaxScoreCollector) next;
Expand Down Expand Up @@ -339,9 +338,7 @@ public Object reduce(Collection collectors) throws IOException {
Collector collector;
for (Object o : collectors) {
collector = (Collector) o;
if (collector instanceof EarlyTerminatingCollector) {
EarlyTerminatingCollector earlyTerminatingCollector =
(EarlyTerminatingCollector) collector;
if (collector instanceof final EarlyTerminatingCollector earlyTerminatingCollector) {
collector = earlyTerminatingCollector.getDelegate();
}
if (collector instanceof TopDocsCollector) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,10 @@ private Collector buildAndRunCollectorChain(
if (cmd.isQueryCancellable()) {
core.getCancellableQueryTracker().removeCancellableQuery(cmd.getQueryID());
}
if (collector instanceof EarlyTerminatingCollector) {
qr.setTerminatedEarly(((EarlyTerminatingCollector) collector).isTerminatedEarly());
if (collector instanceof final EarlyTerminatingCollector earlyTerminatingCollector) {
if (earlyTerminatingCollector.isTerminatedEarly()) {
qr.setTerminatedEarly(true);
}
}
}
if (collector instanceof DelegatingCollector) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ public interface CommonParams {
*/
String MEM_ALLOWED = "memAllowed";

/** The max hits to be collected per shard */
String MAX_HITS_PER_SHARD = "maxHitsPerShard";
/** The max hits to be collected per shard. */
String MAX_HITS_PER_SHARD = "maxHits";

/** Is the query cancellable? */
String IS_QUERY_CANCELLABLE = "canCancel";
Expand Down

0 comments on commit 9653d00

Please sign in to comment.