From 36ee8bb0fc0604042b6353338fd5dfed9435de61 Mon Sep 17 00:00:00 2001 From: Siju Varghese Date: Thu, 9 Jan 2025 10:31:11 -0800 Subject: [PATCH] SOLR-17447 : Support for maxHitsPerShard. rename parameter to maxHits --- .../java/org/apache/solr/search/MultiThreadedSearcher.java | 7 ++----- .../java/org/apache/solr/common/params/CommonParams.java | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/search/MultiThreadedSearcher.java b/solr/core/src/java/org/apache/solr/search/MultiThreadedSearcher.java index 727f1834eb7..67bf7ef3f7b 100644 --- a/solr/core/src/java/org/apache/solr/search/MultiThreadedSearcher.java +++ b/solr/core/src/java/org/apache/solr/search/MultiThreadedSearcher.java @@ -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; @@ -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) { diff --git a/solr/solrj/src/java/org/apache/solr/common/params/CommonParams.java b/solr/solrj/src/java/org/apache/solr/common/params/CommonParams.java index 5160edc8c83..7c4d2acbebd 100644 --- a/solr/solrj/src/java/org/apache/solr/common/params/CommonParams.java +++ b/solr/solrj/src/java/org/apache/solr/common/params/CommonParams.java @@ -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";