Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

Test fix AnalyticsMergeStrategyTest (#3639)

David Smileyc0e4dfde99dd
diff --git a/solr/core/src/test/org/apache/solr/search/AnalyticsMergeStrategyTest.java b/solr/core/src/test/org/apache/solr/search/AnalyticsMergeStrategyTest.java
index f8409483bea..c2b25582465 100644
--- a/solr/core/src/test/org/apache/solr/search/AnalyticsMergeStrategyTest.java
+++ b/solr/core/src/test/org/apache/solr/search/AnalyticsMergeStrategyTest.java
@@ -27,9 +27,7 @@ import org.junit.BeforeClass;
import org.junit.Test;
/**
- * Test for QueryComponent's distributed querying
- *
- * @see org.apache.solr.handler.component.QueryComponent
+ * Tests {@link AnalyticsQuery} and {@link org.apache.solr.handler.component.IterativeMergeStrategy}
*/
@SolrTestCaseJ4.SuppressSSL(bugUrl = "https://issues.apache.org/jira/browse/SOLR-8433")
@ThreadLeakScope(Scope.NONE)
@@ -64,15 +62,16 @@ public class AnalyticsMergeStrategyTest extends BaseDistributedSearchTestCase {
commit();
/*
- * The count qparser plugin is pointing to AnalyticsTestQParserPlugin. This class defines a simple AnalyticsQuery and
- * has two merge strategies. If the "iterate" local param is true then an InteractiveMergeStrategy is used.
+ * The count qparser plugin is pointing to AnalyticsTestQParserPlugin. This class defines a
+ * simple AnalyticsQuery and has two merge strategies. If the "iterate" local param is true then
+ * an IterativeMergeStrategy is used.
*/
ModifiableSolrParams params = new ModifiableSolrParams();
params.add("q", "*:*");
params.add("fq", "{!count}");
setDistributedParams(params);
- QueryResponse rsp = query(params);
+ QueryResponse rsp = queryRandomShard(params);
assertCount(rsp, 11);
// Test IterativeMergeStrategy
@@ -80,14 +79,14 @@ public class AnalyticsMergeStrategyTest extends BaseDistributedSearchTestCase {
params.add("q", "*:*");
params.add("fq", "{!count iterate=true}");
setDistributedParams(params);
- rsp = query(params);
+ rsp = queryRandomShard(params);
assertCountOnly(rsp, 44);
params = new ModifiableSolrParams();
params.add("q", "id:(1 2 5 6)");
params.add("fq", "{!count}");
setDistributedParams(params);
- rsp = query(params);
+ rsp = queryRandomShard(params);
assertCount(rsp, 4);
}