From e1f81b76b9e5635ad56b881e3104e19cdcf615a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 2 Jun 2026 11:22:01 +0200 Subject: [PATCH 01/22] Speed up DistributedCombinedQueryComponentTest from 80s to 10s --- ...DistributedCombinedQueryComponentTest.java | 101 ++++++------------ 1 file changed, 32 insertions(+), 69 deletions(-) diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java index bb9105cad302..847c05092088 100644 --- a/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java +++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java @@ -110,28 +110,6 @@ private synchronized void prepareIndexDocs() throws Exception { commit(); } - /** - * Tests a single lexical query against the Solr server using both combiner methods. - * - * @throws Exception if any exception occurs during the test execution - */ - @Test - public void testSingleLexicalQuery() throws Exception { - prepareIndexDocs(); - QueryResponse rsp = - query( - CommonParams.JSON, - "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:2^10\"}}}," - + "\"limit\":5," - + "\"fields\":[\"id\",\"score\",\"title\"]," - + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\"]}}", - CommonParams.QT, - "/search"); - assertEquals(1, rsp.getResults().size()); - assertFieldValues(rsp.getResults(), id, "2"); - } - @Override protected String getShardsString() { if (deadServers == null) return shards; @@ -145,54 +123,55 @@ protected String getShardsString() { } /** - * Tests multiple lexical queries using the distributed solr client. + * Tests all combined query variants (single lexical, multiple lexical, sort, pagination, + * faceting, facet+highlighting) against the same 10-document index. * * @throws Exception if any error occurs during the test execution */ @Test - public void testMultipleLexicalQuery() throws Exception { + public void testCombinedQueries() throws Exception { prepareIndexDocs(); - String jsonQuery = + + // single lexical query + QueryResponse rsp = + query( + CommonParams.JSON, + "{\"queries\":" + + "{\"lexical1\":{\"lucene\":{\"query\":\"id:2^10\"}}}," + + "\"limit\":5," + + "\"fields\":[\"id\",\"score\",\"title\"]," + + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\"]}}", + CommonParams.QT, + "/search"); + assertEquals(1, rsp.getResults().size()); + assertFieldValues(rsp.getResults(), id, "2"); + + // multiple lexical queries + String multiQuery = "{\"queries\":" + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^2 OR 3^1 OR 6^2 OR 5^1)\"}}," + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^1 OR 5^2 OR 7^3 OR 10^2)\"}}}," + "\"limit\":5," + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}"; - QueryResponse rsp = query(CommonParams.JSON, jsonQuery, CommonParams.QT, "/search"); + rsp = query(CommonParams.JSON, multiQuery, CommonParams.QT, "/search"); assertEquals(5, rsp.getResults().size()); assertFieldValues(rsp.getResults(), id, "5", "7", "2", "6", "3"); - } - /** - * Test multiple query execution with sort. - * - * @throws Exception the exception - */ - @Test - public void testMultipleQueryWithSort() throws Exception { - prepareIndexDocs(); - String jsonQuery = + // multiple queries with sort + String sortQuery = "{\"queries\":" + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^2 OR 3^1 OR 6^2 OR 5^1)\"}}," + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^1 OR 5^2 OR 7^3 OR 10^2)\"}}}," + "\"limit\":5,\"sort\":\"mod3_idv desc, score desc\"" + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}"; - QueryResponse rsp = query(CommonParams.JSON, jsonQuery, CommonParams.QT, "/search"); + rsp = query(CommonParams.JSON, sortQuery, CommonParams.QT, "/search"); assertEquals(5, rsp.getResults().size()); assertFieldValues(rsp.getResults(), id, "5", "2", "7", "10", "4"); - } - /** - * Tests the hybrid query functionality of the system with various setting of pagination. - * - * @throws Exception if any unexpected error occurs during the test execution. - */ - @Test - public void testHybridQueryWithPagination() throws Exception { - prepareIndexDocs(); - QueryResponse rsp = + // pagination + rsp = query( CommonParams.JSON, "{\"queries\":" @@ -228,38 +207,22 @@ public void testHybridQueryWithPagination() throws Exception { "/search"); assertEquals(4, rsp.getResults().size()); assertFieldValues(rsp.getResults(), id, "6", "3", "10", "4"); - } - /** - * Tests the single query functionality with faceting only. - * - * @throws Exception if any unexpected error occurs during the test execution. - */ - @Test - public void testQueryWithFaceting() throws Exception { - prepareIndexDocs(); - String jsonQuery = + // faceting + String facetQuery = "{\"queries\":" + "{\"lexical\":{\"lucene\":{\"query\":\"id:(2^2 OR 3^1 OR 6^2 OR 5^1)\"}}}," + "\"limit\":3,\"offset\":1" + "\"fields\":[\"id\",\"score\",\"title\"]," + "\"params\":{\"combiner\":true,\"facet\":true,\"facet.field\":\"mod3_idv\",\"facet.mincount\":1," + "\"combiner.query\":[\"lexical\"]}}"; - QueryResponse rsp = query(CommonParams.JSON, jsonQuery, CommonParams.QT, "/search"); + rsp = query(CommonParams.JSON, facetQuery, CommonParams.QT, "/search"); assertEquals(3, rsp.getResults().size()); assertEquals(4, rsp.getResults().getNumFound()); assertEquals("[0 (2), 2 (2)]", rsp.getFacetFields().getFirst().getValues().toString()); - } - /** - * Tests the combined query feature with faceting and highlighting. - * - * @throws Exception if any unexpected error occurs during the test execution. - */ - @Test - public void testQueriesWithFacetAndHighlights() throws Exception { - prepareIndexDocs(); - String jsonQuery = + // faceting + highlighting + String facetHlQuery = "{\"queries\":" + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^2 OR 3^1 OR 6^2 OR 5^1)\"}}," + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^1 OR 5^2 OR 7^3 OR 10^2)\"}}}," @@ -268,7 +231,7 @@ public void testQueriesWithFacetAndHighlights() throws Exception { + "\"params\":{\"combiner\":true,\"facet\":true,\"facet.field\":\"mod3_idv\"," + "\"combiner.query\":[\"lexical1\",\"lexical2\"], \"hl\": true," + "\"hl.fl\": \"title\",\"hl.q\":\"test doc\"}}"; - QueryResponse rsp = query(CommonParams.JSON, jsonQuery, CommonParams.QT, "/search"); + rsp = query(CommonParams.JSON, facetHlQuery, CommonParams.QT, "/search"); assertEquals(4, rsp.getResults().size()); assertFieldValues(rsp.getResults(), id, "5", "7", "2", "6"); assertEquals("mod3_idv", rsp.getFacetFields().getFirst().getName()); From 3672ebdede65bbbe8a629fbc638cd10ced1889f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 2 Jun 2026 12:49:28 +0200 Subject: [PATCH 02/22] Reduce RandomizedTaggerTest @Repeat to 2 for regular CI; add nightly subclass with full 10 iterations --- .../tagger/RandomizedTaggerNightlyTest.java | 25 +++++++++++++++++++ .../handler/tagger/RandomizedTaggerTest.java | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 solr/core/src/test/org/apache/solr/handler/tagger/RandomizedTaggerNightlyTest.java diff --git a/solr/core/src/test/org/apache/solr/handler/tagger/RandomizedTaggerNightlyTest.java b/solr/core/src/test/org/apache/solr/handler/tagger/RandomizedTaggerNightlyTest.java new file mode 100644 index 000000000000..25d7b74582fa --- /dev/null +++ b/solr/core/src/test/org/apache/solr/handler/tagger/RandomizedTaggerNightlyTest.java @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.solr.handler.tagger; + +import com.carrotsearch.randomizedtesting.annotations.Repeat; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; + +/** Nightly variant of {@link RandomizedTaggerTest} that runs the full 10 iterations. */ +@Nightly +@Repeat(iterations = 10) +public class RandomizedTaggerNightlyTest extends RandomizedTaggerTest {} diff --git a/solr/core/src/test/org/apache/solr/handler/tagger/RandomizedTaggerTest.java b/solr/core/src/test/org/apache/solr/handler/tagger/RandomizedTaggerTest.java index 0d7704129528..ea0fd1bc6abb 100644 --- a/solr/core/src/test/org/apache/solr/handler/tagger/RandomizedTaggerTest.java +++ b/solr/core/src/test/org/apache/solr/handler/tagger/RandomizedTaggerTest.java @@ -36,7 +36,7 @@ import org.junit.Test; /** Randomly generate taggable text and verify via simple tag algorithm. */ -@Repeat(iterations = 10) +@Repeat(iterations = 2) public class RandomizedTaggerTest extends TaggerTestCase { @BeforeClass From aa2397a8bf1c3b1ef4cce589048954aca357e9a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 2 Jun 2026 12:49:53 +0200 Subject: [PATCH 03/22] Reduce TestSolr4Spatial2 @Repeat to 2 for regular CI; add nightly subclass with full 10 iterations --- .../apache/solr/search/TestSolr4Spatial2.java | 2 +- .../solr/search/TestSolr4Spatial2Nightly.java | 36 +++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 solr/core/src/test/org/apache/solr/search/TestSolr4Spatial2Nightly.java diff --git a/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial2.java b/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial2.java index d5e23623bfa4..2c4e7662990e 100644 --- a/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial2.java +++ b/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial2.java @@ -180,7 +180,7 @@ public void testRptWithGeometryGeo3dS2Field() throws Exception { } @Test - @Repeat(iterations = 10) + @Repeat(iterations = 2) public void testLLPDecodeIsStableAndPrecise() throws Exception { // test that LatLonPointSpatialField decode of docValue will round-trip (re-index then // re-decode) to the same value diff --git a/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial2Nightly.java b/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial2Nightly.java new file mode 100644 index 000000000000..e542d32b8b0a --- /dev/null +++ b/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial2Nightly.java @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.solr.search; + +import com.carrotsearch.randomizedtesting.annotations.Repeat; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; +import org.junit.Test; + +/** + * Nightly variant of {@link TestSolr4Spatial2} that runs {@code + * testLLPDecodeIsStableAndPrecise} the full 10 iterations. + */ +@Nightly +public class TestSolr4Spatial2Nightly extends TestSolr4Spatial2 { + + @Test + @Repeat(iterations = 10) + @Override + public void testLLPDecodeIsStableAndPrecise() throws Exception { + super.testLLPDecodeIsStableAndPrecise(); + } +} From 62bef766e90f14b61965fbb73a5bf6110468d434 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 2 Jun 2026 12:50:16 +0200 Subject: [PATCH 04/22] Reduce SpatialHeatmapFacetsTest @Repeat to 1 for regular CI; add nightly subclass with full 3 iterations --- .../SpatialHeatmapFacetsNightlyTest.java | 36 +++++++++++++++++++ .../facet/SpatialHeatmapFacetsTest.java | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 solr/core/src/test/org/apache/solr/search/facet/SpatialHeatmapFacetsNightlyTest.java diff --git a/solr/core/src/test/org/apache/solr/search/facet/SpatialHeatmapFacetsNightlyTest.java b/solr/core/src/test/org/apache/solr/search/facet/SpatialHeatmapFacetsNightlyTest.java new file mode 100644 index 000000000000..4c138ecc680d --- /dev/null +++ b/solr/core/src/test/org/apache/solr/search/facet/SpatialHeatmapFacetsNightlyTest.java @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.solr.search.facet; + +import com.carrotsearch.randomizedtesting.annotations.Repeat; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; +import org.junit.Test; + +/** + * Nightly variant of {@link SpatialHeatmapFacetsTest} that runs {@code testPng} the full 3 + * iterations. + */ +@Nightly +public class SpatialHeatmapFacetsNightlyTest extends SpatialHeatmapFacetsTest { + + @Test + @Repeat(iterations = 3) + @Override + public void testPng() { + super.testPng(); + } +} diff --git a/solr/core/src/test/org/apache/solr/search/facet/SpatialHeatmapFacetsTest.java b/solr/core/src/test/org/apache/solr/search/facet/SpatialHeatmapFacetsTest.java index 6f48e473bcab..028486496df9 100644 --- a/solr/core/src/test/org/apache/solr/search/facet/SpatialHeatmapFacetsTest.java +++ b/solr/core/src/test/org/apache/solr/search/facet/SpatialHeatmapFacetsTest.java @@ -516,7 +516,7 @@ private NamedList getHmObj(QueryResponse response) { } @Test - @Repeat(iterations = 3) + @Repeat(iterations = 1) public void testPng() { // We test via round-trip randomized data: From 47090e88f474739208d6ec54972b04edd0dd20f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 2 Jun 2026 12:50:40 +0200 Subject: [PATCH 05/22] Reduce CloudExitableDirectoryReaderTest @Repeat to 2 for regular CI; add nightly subclass with full 5 iterations --- ...oudExitableDirectoryReaderNightlyTest.java | 36 +++++++++++++++++++ .../CloudExitableDirectoryReaderTest.java | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 solr/core/src/test/org/apache/solr/cloud/CloudExitableDirectoryReaderNightlyTest.java diff --git a/solr/core/src/test/org/apache/solr/cloud/CloudExitableDirectoryReaderNightlyTest.java b/solr/core/src/test/org/apache/solr/cloud/CloudExitableDirectoryReaderNightlyTest.java new file mode 100644 index 000000000000..207602713a4b --- /dev/null +++ b/solr/core/src/test/org/apache/solr/cloud/CloudExitableDirectoryReaderNightlyTest.java @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.solr.cloud; + +import com.carrotsearch.randomizedtesting.annotations.Repeat; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; +import org.junit.Test; + +/** + * Nightly variant of {@link CloudExitableDirectoryReaderTest} that runs {@code testCreepThenBite} + * the full 5 iterations. + */ +@Nightly +public class CloudExitableDirectoryReaderNightlyTest extends CloudExitableDirectoryReaderTest { + + @Test + @Repeat(iterations = 5) + @Override + public void testCreepThenBite() throws Exception { + super.testCreepThenBite(); + } +} diff --git a/solr/core/src/test/org/apache/solr/cloud/CloudExitableDirectoryReaderTest.java b/solr/core/src/test/org/apache/solr/cloud/CloudExitableDirectoryReaderTest.java index cd3dced45cff..5499f2961cf5 100644 --- a/solr/core/src/test/org/apache/solr/cloud/CloudExitableDirectoryReaderTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/CloudExitableDirectoryReaderTest.java @@ -295,7 +295,7 @@ public void testClearbox() throws Exception { } @Test - @Repeat(iterations = 5) + @Repeat(iterations = 2) public void testCreepThenBite() throws Exception { int creep = 100; ModifiableSolrParams params = params("q", "{!cache=false}name:a*"); From 8e59e40775c9655167d6111c0dee99f8602e476c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 2 Jun 2026 12:50:58 +0200 Subject: [PATCH 06/22] Move RollingRestartTest to @Nightly: runs 2 restarts in reduced mode, not meaningful at that scale --- .../core/src/test/org/apache/solr/cloud/RollingRestartTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/solr/core/src/test/org/apache/solr/cloud/RollingRestartTest.java b/solr/core/src/test/org/apache/solr/cloud/RollingRestartTest.java index aa08e8717228..5269b18a954c 100644 --- a/solr/core/src/test/org/apache/solr/cloud/RollingRestartTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/RollingRestartTest.java @@ -24,10 +24,12 @@ import org.apache.solr.common.cloud.SolrZkClient; import org.apache.solr.common.cloud.ZkStateReader; import org.apache.zookeeper.KeeperException; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@Nightly public class RollingRestartTest extends AbstractFullDistribZkTestBase { private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); From 223600ab391307cd7428c0aa4b93a49a7449bf38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 2 Jun 2026 12:51:14 +0200 Subject: [PATCH 07/22] Move SyncSliceTest to @Nightly: 37s at reduced 4-shard config, too slow for regular CI --- solr/core/src/test/org/apache/solr/cloud/SyncSliceTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/solr/core/src/test/org/apache/solr/cloud/SyncSliceTest.java b/solr/core/src/test/org/apache/solr/cloud/SyncSliceTest.java index 8f49afba9701..2d22da5814b7 100644 --- a/solr/core/src/test/org/apache/solr/cloud/SyncSliceTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/SyncSliceTest.java @@ -38,12 +38,14 @@ import org.apache.solr.common.cloud.ZkStateReader; import org.apache.solr.common.params.CollectionParams.CollectionAction; import org.apache.solr.common.params.ModifiableSolrParams; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.apache.solr.util.LogLevel; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** Test sync phase that occurs when Leader goes down and a new Leader is elected. */ +@Nightly @LogLevel("org.apache.solr.update.processor.DistributedZkUpdateProcessor=WARN") public class SyncSliceTest extends AbstractFullDistribZkTestBase { private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); From d04d6062cffe23b6f32173bf6c4c5b2fe0b2294d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 2 Jun 2026 12:51:32 +0200 Subject: [PATCH 08/22] Move RecoveryZkTest to @Nightly: non-nightly run skips most test logic via if (!TEST_NIGHTLY) return --- solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java b/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java index 48d4855c1d20..195889267ad9 100644 --- a/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java @@ -30,12 +30,14 @@ import org.apache.solr.common.cloud.Replica; import org.apache.solr.common.cloud.Slice; import org.apache.solr.embedded.JettySolrRunner; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.junit.After; import org.junit.BeforeClass; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@Nightly public class RecoveryZkTest extends SolrCloudTestCase { private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); From 7e4c584a224d96a4ce4fd0c79b002c5b7a18af9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 2 Jun 2026 12:53:39 +0200 Subject: [PATCH 09/22] Add @Nightly to UnloadDistributedZkTest This is an integration test with heavy ZooKeeper interaction and multiple cluster restarts. Move to nightly-only to reduce regular CI time. --- .../src/test/org/apache/solr/cloud/UnloadDistributedZkTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/solr/core/src/test/org/apache/solr/cloud/UnloadDistributedZkTest.java b/solr/core/src/test/org/apache/solr/cloud/UnloadDistributedZkTest.java index ce003c19fb72..eaab53365cf0 100644 --- a/solr/core/src/test/org/apache/solr/cloud/UnloadDistributedZkTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/UnloadDistributedZkTest.java @@ -27,6 +27,7 @@ import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.apache.solr.SolrTestCaseJ4.SuppressSSL; import org.apache.solr.client.solrj.SolrClient; import org.apache.solr.client.solrj.SolrServerException; @@ -53,6 +54,7 @@ * This test simply does a bunch of basic things in solrcloud mode and asserts things work as * expected. */ +@Nightly @SuppressSSL(bugUrl = "https://issues.apache.org/jira/browse/SOLR-5776") public class UnloadDistributedZkTest extends AbstractFullDistribZkTestBase { private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); From 04649e526f09b47422240141679280508eec7399 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 2 Jun 2026 12:54:11 +0200 Subject: [PATCH 10/22] Add @Nightly to SolrAndKafkaIntegrationTest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Integration test requiring embedded Kafka cluster — inherently slow and resource-intensive. Move to nightly-only to reduce regular CI overhead. --- .../solr/crossdc/manager/SolrAndKafkaIntegrationTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/solr/cross-dc-manager/src/test/org/apache/solr/crossdc/manager/SolrAndKafkaIntegrationTest.java b/solr/cross-dc-manager/src/test/org/apache/solr/crossdc/manager/SolrAndKafkaIntegrationTest.java index e42ac3844a39..48121fb3c18c 100644 --- a/solr/cross-dc-manager/src/test/org/apache/solr/crossdc/manager/SolrAndKafkaIntegrationTest.java +++ b/solr/cross-dc-manager/src/test/org/apache/solr/crossdc/manager/SolrAndKafkaIntegrationTest.java @@ -86,6 +86,7 @@ import org.apache.solr.util.TimeOut; import org.junit.After; import org.junit.Before; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; @@ -93,6 +94,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@Nightly @ThreadLeakFilters( filters = { SolrIgnoredThreadsFilter.class, From 71ed99e77e3a6dccbd445b511600878032c710ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 2 Jun 2026 12:55:03 +0200 Subject: [PATCH 11/22] Add @Nightly to GCSIncrementalBackupTest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Full GCS backup/restore integration test — slow by nature. Move to nightly to reduce regular CI run time. --- .../src/test/org/apache/solr/gcs/GCSIncrementalBackupTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/solr/modules/gcs-repository/src/test/org/apache/solr/gcs/GCSIncrementalBackupTest.java b/solr/modules/gcs-repository/src/test/org/apache/solr/gcs/GCSIncrementalBackupTest.java index d955da11e1eb..e332a49931b0 100644 --- a/solr/modules/gcs-repository/src/test/org/apache/solr/gcs/GCSIncrementalBackupTest.java +++ b/solr/modules/gcs-repository/src/test/org/apache/solr/gcs/GCSIncrementalBackupTest.java @@ -26,6 +26,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@LuceneTestCase.Nightly @ThreadLeakLingering(linger = 10) @LuceneTestCase.SuppressCodecs({ "SimpleText" From f908b9388d2a62fdc8d106cd6b493ff5a963e518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 2 Jun 2026 12:55:12 +0200 Subject: [PATCH 12/22] Add @Nightly to S3IncrementalBackupTest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Full S3 backup/restore integration test using an embedded S3Mock — slow by nature. Move to nightly to reduce regular CI run time. --- .../src/test/org/apache/solr/s3/S3IncrementalBackupTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/solr/modules/s3-repository/src/test/org/apache/solr/s3/S3IncrementalBackupTest.java b/solr/modules/s3-repository/src/test/org/apache/solr/s3/S3IncrementalBackupTest.java index c35dbc17ab0e..28062aea557c 100644 --- a/solr/modules/s3-repository/src/test/org/apache/solr/s3/S3IncrementalBackupTest.java +++ b/solr/modules/s3-repository/src/test/org/apache/solr/s3/S3IncrementalBackupTest.java @@ -30,6 +30,7 @@ import software.amazon.awssdk.regions.Region; // Backups do checksum validation against a footer value not present in 'SimpleText' +@LuceneTestCase.Nightly @LuceneTestCase.SuppressCodecs({"SimpleText"}) @ThreadLeakLingering(linger = 10) @LogLevel( From 618b8d0adadeee1daabed520a3b9be914a459a11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 2 Jun 2026 12:56:13 +0200 Subject: [PATCH 13/22] Add @Nightly to BadClusterTest Integration test that progressively degrades a live cluster. Slow and resource-intensive by design. Move to nightly-only CI. --- .../org/apache/solr/client/solrj/io/stream/BadClusterTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/BadClusterTest.java b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/BadClusterTest.java index 089f85e1bc5e..24ef1245a82b 100644 --- a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/BadClusterTest.java +++ b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/BadClusterTest.java @@ -32,11 +32,13 @@ import org.apache.solr.common.cloud.Replica; import org.apache.solr.common.params.CommonParams; import org.apache.solr.common.params.MultiMapSolrParams; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.hamcrest.Matchers; import org.junit.BeforeClass; import org.junit.Test; /** Tests behaviors of CloudSolrStream when the cluster is behaving badly. */ +@Nightly @SolrTestCaseJ4.SuppressSSL public class BadClusterTest extends SolrCloudTestCase { From 0bd8775317404b17fee2d3e8a731c95926049853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 2 Jun 2026 12:57:17 +0200 Subject: [PATCH 14/22] Add @Nightly to PerReplicaStatesIntegrationTest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Integration test for per-replica ZK state management — creates multiple clusters per test method. Even the file's Javadoc notes it would be faster with ZK simulation. Move to nightly-only CI. --- .../solr/common/cloud/PerReplicaStatesIntegrationTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/solr/solrj/src/test/org/apache/solr/common/cloud/PerReplicaStatesIntegrationTest.java b/solr/solrj/src/test/org/apache/solr/common/cloud/PerReplicaStatesIntegrationTest.java index e996c111a464..03422139f8b4 100644 --- a/solr/solrj/src/test/org/apache/solr/common/cloud/PerReplicaStatesIntegrationTest.java +++ b/solr/solrj/src/test/org/apache/solr/common/cloud/PerReplicaStatesIntegrationTest.java @@ -33,6 +33,7 @@ import org.apache.solr.cloud.SolrCloudTestCase; import org.apache.solr.common.NavigableObject; import org.apache.solr.common.util.Utils; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.apache.solr.embedded.JettySolrRunner; import org.apache.solr.util.LogLevel; import org.apache.zookeeper.data.Stat; @@ -40,6 +41,7 @@ import org.slf4j.LoggerFactory; /** This test would be faster if we simulated the zk state instead. */ +@Nightly @LogLevel( "org.apache.solr.common.cloud.ZkStateReader=DEBUG;" + "org.apache.solr.cloud.overseer.ZkStateWriter=DEBUG;" From 7737019f5e7ac9cbd071e4945eafec766d65ccb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 2 Jun 2026 12:58:04 +0200 Subject: [PATCH 15/22] Add @Nightly to TestPullReplica MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Has @Repeat(30) on testCreateDelete and exercises pull replica replication across multiple test methods — one of the heaviest cloud tests. Move to nightly-only CI where the high repeat count is appropriate. --- solr/core/src/test/org/apache/solr/cloud/TestPullReplica.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/solr/core/src/test/org/apache/solr/cloud/TestPullReplica.java b/solr/core/src/test/org/apache/solr/cloud/TestPullReplica.java index b2d307aa8521..54628f4ce9e8 100644 --- a/solr/core/src/test/org/apache/solr/cloud/TestPullReplica.java +++ b/solr/core/src/test/org/apache/solr/cloud/TestPullReplica.java @@ -60,6 +60,7 @@ import org.apache.solr.util.TimeOut; import org.apache.zookeeper.KeeperException; import org.eclipse.jetty.client.StringRequestContent; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Ignore; @@ -67,6 +68,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@Nightly @LogLevel( "org.apache.solr.handler.ReplicationHandler=DEBUG;org.apache.solr.handler.IndexFetcher=DEBUG") public class TestPullReplica extends SolrCloudTestCase { From c285186e7ef67710e4c05f0af26f7aad6d0d6aeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 2 Jun 2026 12:59:01 +0200 Subject: [PATCH 16/22] Apply tidy formatting (import ordering) --- solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java | 2 +- .../src/test/org/apache/solr/cloud/RollingRestartTest.java | 2 +- solr/core/src/test/org/apache/solr/cloud/SyncSliceTest.java | 2 +- solr/core/src/test/org/apache/solr/cloud/TestPullReplica.java | 2 +- .../test/org/apache/solr/search/TestSolr4Spatial2Nightly.java | 4 ++-- .../solr/crossdc/manager/SolrAndKafkaIntegrationTest.java | 2 +- .../apache/solr/client/solrj/io/stream/BadClusterTest.java | 2 +- .../solr/common/cloud/PerReplicaStatesIntegrationTest.java | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java b/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java index 195889267ad9..c56f957da10f 100644 --- a/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java @@ -20,6 +20,7 @@ import java.util.ArrayList; import java.util.List; import java.util.concurrent.TimeUnit; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.apache.solr.client.solrj.SolrClient; import org.apache.solr.client.solrj.apache.CloudLegacySolrClient; import org.apache.solr.client.solrj.apache.HttpSolrClient; @@ -30,7 +31,6 @@ import org.apache.solr.common.cloud.Replica; import org.apache.solr.common.cloud.Slice; import org.apache.solr.embedded.JettySolrRunner; -import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.junit.After; import org.junit.BeforeClass; import org.junit.Test; diff --git a/solr/core/src/test/org/apache/solr/cloud/RollingRestartTest.java b/solr/core/src/test/org/apache/solr/cloud/RollingRestartTest.java index 5269b18a954c..caea6e59015e 100644 --- a/solr/core/src/test/org/apache/solr/cloud/RollingRestartTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/RollingRestartTest.java @@ -20,11 +20,11 @@ import java.util.ArrayList; import java.util.List; import java.util.concurrent.TimeUnit; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.apache.solr.client.solrj.request.CollectionAdminRequest; import org.apache.solr.common.cloud.SolrZkClient; import org.apache.solr.common.cloud.ZkStateReader; import org.apache.zookeeper.KeeperException; -import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/solr/core/src/test/org/apache/solr/cloud/SyncSliceTest.java b/solr/core/src/test/org/apache/solr/cloud/SyncSliceTest.java index 2d22da5814b7..539461360e96 100644 --- a/solr/core/src/test/org/apache/solr/cloud/SyncSliceTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/SyncSliceTest.java @@ -26,6 +26,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.stream.Collectors; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.apache.solr.client.solrj.SolrClient; import org.apache.solr.client.solrj.SolrRequest; import org.apache.solr.client.solrj.SolrServerException; @@ -38,7 +39,6 @@ import org.apache.solr.common.cloud.ZkStateReader; import org.apache.solr.common.params.CollectionParams.CollectionAction; import org.apache.solr.common.params.ModifiableSolrParams; -import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.apache.solr.util.LogLevel; import org.junit.Test; import org.slf4j.Logger; diff --git a/solr/core/src/test/org/apache/solr/cloud/TestPullReplica.java b/solr/core/src/test/org/apache/solr/cloud/TestPullReplica.java index 54628f4ce9e8..5eae4dca5d3b 100644 --- a/solr/core/src/test/org/apache/solr/cloud/TestPullReplica.java +++ b/solr/core/src/test/org/apache/solr/cloud/TestPullReplica.java @@ -33,6 +33,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.stream.Collectors; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.apache.solr.client.solrj.SolrClient; import org.apache.solr.client.solrj.SolrServerException; import org.apache.solr.client.solrj.request.CollectionAdminRequest; @@ -60,7 +61,6 @@ import org.apache.solr.util.TimeOut; import org.apache.zookeeper.KeeperException; import org.eclipse.jetty.client.StringRequestContent; -import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Ignore; diff --git a/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial2Nightly.java b/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial2Nightly.java index e542d32b8b0a..2c12370df081 100644 --- a/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial2Nightly.java +++ b/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial2Nightly.java @@ -21,8 +21,8 @@ import org.junit.Test; /** - * Nightly variant of {@link TestSolr4Spatial2} that runs {@code - * testLLPDecodeIsStableAndPrecise} the full 10 iterations. + * Nightly variant of {@link TestSolr4Spatial2} that runs {@code testLLPDecodeIsStableAndPrecise} + * the full 10 iterations. */ @Nightly public class TestSolr4Spatial2Nightly extends TestSolr4Spatial2 { diff --git a/solr/cross-dc-manager/src/test/org/apache/solr/crossdc/manager/SolrAndKafkaIntegrationTest.java b/solr/cross-dc-manager/src/test/org/apache/solr/crossdc/manager/SolrAndKafkaIntegrationTest.java index 48121fb3c18c..797080454b5a 100644 --- a/solr/cross-dc-manager/src/test/org/apache/solr/crossdc/manager/SolrAndKafkaIntegrationTest.java +++ b/solr/cross-dc-manager/src/test/org/apache/solr/crossdc/manager/SolrAndKafkaIntegrationTest.java @@ -52,6 +52,7 @@ import org.apache.kafka.clients.producer.ProducerRecord; import org.apache.kafka.common.serialization.StringSerializer; import org.apache.kafka.streams.integration.utils.EmbeddedKafkaCluster; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.apache.lucene.tests.util.QuickPatchThreadsFilter; import org.apache.solr.SolrIgnoredThreadsFilter; import org.apache.solr.client.solrj.SolrClient; @@ -86,7 +87,6 @@ import org.apache.solr.util.TimeOut; import org.junit.After; import org.junit.Before; -import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; diff --git a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/BadClusterTest.java b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/BadClusterTest.java index 24ef1245a82b..d20cba1e3740 100644 --- a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/BadClusterTest.java +++ b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/BadClusterTest.java @@ -21,6 +21,7 @@ import java.util.List; import java.util.Map; import java.util.concurrent.TimeoutException; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.apache.solr.SolrTestCaseJ4; import org.apache.solr.client.solrj.io.Tuple; import org.apache.solr.client.solrj.io.stream.expr.StreamExpression; @@ -32,7 +33,6 @@ import org.apache.solr.common.cloud.Replica; import org.apache.solr.common.params.CommonParams; import org.apache.solr.common.params.MultiMapSolrParams; -import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.hamcrest.Matchers; import org.junit.BeforeClass; import org.junit.Test; diff --git a/solr/solrj/src/test/org/apache/solr/common/cloud/PerReplicaStatesIntegrationTest.java b/solr/solrj/src/test/org/apache/solr/common/cloud/PerReplicaStatesIntegrationTest.java index 03422139f8b4..1bd299676577 100644 --- a/solr/solrj/src/test/org/apache/solr/common/cloud/PerReplicaStatesIntegrationTest.java +++ b/solr/solrj/src/test/org/apache/solr/common/cloud/PerReplicaStatesIntegrationTest.java @@ -24,6 +24,7 @@ import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; +import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.apache.solr.client.solrj.SolrClient; import org.apache.solr.client.solrj.request.CollectionAdminRequest; import org.apache.solr.client.solrj.request.V2Request; @@ -33,7 +34,6 @@ import org.apache.solr.cloud.SolrCloudTestCase; import org.apache.solr.common.NavigableObject; import org.apache.solr.common.util.Utils; -import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.apache.solr.embedded.JettySolrRunner; import org.apache.solr.util.LogLevel; import org.apache.zookeeper.data.Stat; From 631668bb9d7fc15619207da4ce59d449d3b37ff8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 2 Jun 2026 13:11:13 +0200 Subject: [PATCH 17/22] Reduce repeat count to 1 for non-nightly --- .../org/apache/solr/cloud/CloudExitableDirectoryReaderTest.java | 2 +- .../org/apache/solr/handler/tagger/RandomizedTaggerTest.java | 2 +- .../core/src/test/org/apache/solr/search/TestSolr4Spatial2.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/solr/core/src/test/org/apache/solr/cloud/CloudExitableDirectoryReaderTest.java b/solr/core/src/test/org/apache/solr/cloud/CloudExitableDirectoryReaderTest.java index 5499f2961cf5..24d02a389cf4 100644 --- a/solr/core/src/test/org/apache/solr/cloud/CloudExitableDirectoryReaderTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/CloudExitableDirectoryReaderTest.java @@ -295,7 +295,7 @@ public void testClearbox() throws Exception { } @Test - @Repeat(iterations = 2) + @Repeat(iterations = 1) public void testCreepThenBite() throws Exception { int creep = 100; ModifiableSolrParams params = params("q", "{!cache=false}name:a*"); diff --git a/solr/core/src/test/org/apache/solr/handler/tagger/RandomizedTaggerTest.java b/solr/core/src/test/org/apache/solr/handler/tagger/RandomizedTaggerTest.java index ea0fd1bc6abb..4a22552fb633 100644 --- a/solr/core/src/test/org/apache/solr/handler/tagger/RandomizedTaggerTest.java +++ b/solr/core/src/test/org/apache/solr/handler/tagger/RandomizedTaggerTest.java @@ -36,7 +36,7 @@ import org.junit.Test; /** Randomly generate taggable text and verify via simple tag algorithm. */ -@Repeat(iterations = 2) +@Repeat(iterations = 1) public class RandomizedTaggerTest extends TaggerTestCase { @BeforeClass diff --git a/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial2.java b/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial2.java index 2c4e7662990e..19ee80f37006 100644 --- a/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial2.java +++ b/solr/core/src/test/org/apache/solr/search/TestSolr4Spatial2.java @@ -180,7 +180,7 @@ public void testRptWithGeometryGeo3dS2Field() throws Exception { } @Test - @Repeat(iterations = 2) + @Repeat(iterations = 1) public void testLLPDecodeIsStableAndPrecise() throws Exception { // test that LatLonPointSpatialField decode of docValue will round-trip (re-index then // re-decode) to the same value From 3bd0ca661ddc1d72e379e38d0268ec0cd2a55056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 2 Jun 2026 13:19:48 +0200 Subject: [PATCH 18/22] Use text blocks for JSON query strings in DistributedCombinedQueryComponentTest Replaces escaped string concatenations with Java text blocks, making the JSON structure readable. Also fixes a latent bug in facetQuery where a missing comma between "offset":1 and "fields" caused noggit to silently ignore the fields parameter. --- ...DistributedCombinedQueryComponentTest.java | 132 +++++++++--------- 1 file changed, 68 insertions(+), 64 deletions(-) diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java index 847c05092088..e86c239d0dc2 100644 --- a/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java +++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java @@ -136,11 +136,11 @@ public void testCombinedQueries() throws Exception { QueryResponse rsp = query( CommonParams.JSON, - "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:2^10\"}}}," - + "\"limit\":5," - + "\"fields\":[\"id\",\"score\",\"title\"]," - + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\"]}}", + """ + {"queries": {"lexical1": {"lucene": {"query": "id:2^10"}}}, + "limit": 5, + "fields": ["id", "score", "title"], + "params": {"combiner": true, "combiner.query": ["lexical1"]}}""", CommonParams.QT, "/search"); assertEquals(1, rsp.getResults().size()); @@ -148,74 +148,77 @@ public void testCombinedQueries() throws Exception { // multiple lexical queries String multiQuery = - "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^2 OR 3^1 OR 6^2 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^1 OR 5^2 OR 7^3 OR 10^2)\"}}}," - + "\"limit\":5," - + "\"fields\":[\"id\",\"score\",\"title\"]," - + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}"; + """ + {"queries": { + "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 5^1)"}}, + "lexical2": {"lucene": {"query": "id:(4^1 OR 5^2 OR 7^3 OR 10^2)"}}}, + "limit": 5, + "fields": ["id", "score", "title"], + "params": {"combiner": true, "combiner.query": ["lexical1", "lexical2"]}}"""; rsp = query(CommonParams.JSON, multiQuery, CommonParams.QT, "/search"); assertEquals(5, rsp.getResults().size()); assertFieldValues(rsp.getResults(), id, "5", "7", "2", "6", "3"); // multiple queries with sort String sortQuery = - "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^2 OR 3^1 OR 6^2 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^1 OR 5^2 OR 7^3 OR 10^2)\"}}}," - + "\"limit\":5,\"sort\":\"mod3_idv desc, score desc\"" - + "\"fields\":[\"id\",\"score\",\"title\"]," - + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}"; + """ + {"queries": { + "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 5^1)"}}, + "lexical2": {"lucene": {"query": "id:(4^1 OR 5^2 OR 7^3 OR 10^2)"}}}, + "limit": 5, + "sort": "mod3_idv desc, score desc", + "fields": ["id", "score", "title"], + "params": {"combiner": true, "combiner.query": ["lexical1", "lexical2"]}}"""; rsp = query(CommonParams.JSON, sortQuery, CommonParams.QT, "/search"); assertEquals(5, rsp.getResults().size()); assertFieldValues(rsp.getResults(), id, "5", "2", "7", "10", "4"); - // pagination - rsp = - query( - CommonParams.JSON, - "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^2 OR 3^1 OR 6^2 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^1 OR 5^2 OR 7^3 OR 10^2)\"}}}," - + "\"fields\":[\"id\",\"score\",\"title\"]," - + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}", - CommonParams.QT, - "/search"); + // pagination — no limit (all results) + String noLimitQuery = + """ + {"queries": { + "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 5^1)"}}, + "lexical2": {"lucene": {"query": "id:(4^1 OR 5^2 OR 7^3 OR 10^2)"}}}, + "fields": ["id", "score", "title"], + "params": {"combiner": true, "combiner.query": ["lexical1", "lexical2"]}}"""; + rsp = query(CommonParams.JSON, noLimitQuery, CommonParams.QT, "/search"); assertFieldValues(rsp.getResults(), id, "5", "7", "2", "6", "3", "10", "4"); - rsp = - query( - CommonParams.JSON, - "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^2 OR 3^1 OR 6^2 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^1 OR 5^2 OR 7^3 OR 10^2)\"}}}," - + "\"limit\":4," - + "\"fields\":[\"id\",\"score\",\"title\"]," - + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}", - CommonParams.QT, - "/search"); + + // pagination — limit 4 + String limit4Query = + """ + {"queries": { + "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 5^1)"}}, + "lexical2": {"lucene": {"query": "id:(4^1 OR 5^2 OR 7^3 OR 10^2)"}}}, + "limit": 4, + "fields": ["id", "score", "title"], + "params": {"combiner": true, "combiner.query": ["lexical1", "lexical2"]}}"""; + rsp = query(CommonParams.JSON, limit4Query, CommonParams.QT, "/search"); assertFieldValues(rsp.getResults(), id, "5", "7", "2", "6"); - rsp = - query( - CommonParams.JSON, - "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^2 OR 3^1 OR 6^2 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^1 OR 5^2 OR 7^3 OR 10^2)\"}}}," - + "\"limit\":4,\"offset\":3," - + "\"fields\":[\"id\",\"score\",\"title\"]," - + "\"params\":{\"combiner\":true,\"combiner.query\":[\"lexical1\",\"lexical2\"]}}", - CommonParams.QT, - "/search"); + + // pagination — limit 4, offset 3 + String limit4Offset3Query = + """ + {"queries": { + "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 5^1)"}}, + "lexical2": {"lucene": {"query": "id:(4^1 OR 5^2 OR 7^3 OR 10^2)"}}}, + "limit": 4, + "offset": 3, + "fields": ["id", "score", "title"], + "params": {"combiner": true, "combiner.query": ["lexical1", "lexical2"]}}"""; + rsp = query(CommonParams.JSON, limit4Offset3Query, CommonParams.QT, "/search"); assertEquals(4, rsp.getResults().size()); assertFieldValues(rsp.getResults(), id, "6", "3", "10", "4"); // faceting String facetQuery = - "{\"queries\":" - + "{\"lexical\":{\"lucene\":{\"query\":\"id:(2^2 OR 3^1 OR 6^2 OR 5^1)\"}}}," - + "\"limit\":3,\"offset\":1" - + "\"fields\":[\"id\",\"score\",\"title\"]," - + "\"params\":{\"combiner\":true,\"facet\":true,\"facet.field\":\"mod3_idv\",\"facet.mincount\":1," - + "\"combiner.query\":[\"lexical\"]}}"; + """ + {"queries": {"lexical": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 5^1)"}}}, + "limit": 3, + "offset": 1, + "fields": ["id", "score", "title"], + "params": {"combiner": true, "facet": true, "facet.field": "mod3_idv", + "facet.mincount": 1, "combiner.query": ["lexical"]}}"""; rsp = query(CommonParams.JSON, facetQuery, CommonParams.QT, "/search"); assertEquals(3, rsp.getResults().size()); assertEquals(4, rsp.getResults().getNumFound()); @@ -223,14 +226,15 @@ public void testCombinedQueries() throws Exception { // faceting + highlighting String facetHlQuery = - "{\"queries\":" - + "{\"lexical1\":{\"lucene\":{\"query\":\"id:(2^2 OR 3^1 OR 6^2 OR 5^1)\"}}," - + "\"lexical2\":{\"lucene\":{\"query\":\"id:(4^1 OR 5^2 OR 7^3 OR 10^2)\"}}}," - + "\"limit\":4," - + "\"fields\":[\"id\",\"score\",\"title\"]," - + "\"params\":{\"combiner\":true,\"facet\":true,\"facet.field\":\"mod3_idv\"," - + "\"combiner.query\":[\"lexical1\",\"lexical2\"], \"hl\": true," - + "\"hl.fl\": \"title\",\"hl.q\":\"test doc\"}}"; + """ + {"queries": { + "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 5^1)"}}, + "lexical2": {"lucene": {"query": "id:(4^1 OR 5^2 OR 7^3 OR 10^2)"}}}, + "limit": 4, + "fields": ["id", "score", "title"], + "params": {"combiner": true, "facet": true, "facet.field": "mod3_idv", + "combiner.query": ["lexical1", "lexical2"], + "hl": true, "hl.fl": "title", "hl.q": "test doc"}}"""; rsp = query(CommonParams.JSON, facetHlQuery, CommonParams.QT, "/search"); assertEquals(4, rsp.getResults().size()); assertFieldValues(rsp.getResults(), id, "5", "7", "2", "6"); From 6f04f128d9472dc155bee04d278d9880d2eacc82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Fri, 5 Jun 2026 01:12:16 +0200 Subject: [PATCH 19/22] RAT skip check in non-traced files Merge changes from main. --- gradle/validation/rat-sources.gradle | 6 ++ ...DistributedCombinedQueryComponentTest.java | 84 +++++++++---------- 2 files changed, 48 insertions(+), 42 deletions(-) diff --git a/gradle/validation/rat-sources.gradle b/gradle/validation/rat-sources.gradle index f8556d2ffa4f..49e948bc78e3 100644 --- a/gradle/validation/rat-sources.gradle +++ b/gradle/validation/rat-sources.gradle @@ -35,6 +35,12 @@ allprojects { description = 'Runs Apache Rat checks.' def defaultScanFileTree = project.fileTree(projectDir, { + // Only check files tracked by git — skip .gitignore-d files (IDE artifacts, AI assistant configs, etc.) + def trackedFiles = ["git", "ls-files", "--cached"].execute(null, projectDir).text.trim().split("\n").toList().toSet() + exclude { element -> + !element.isDirectory() && !trackedFiles.contains(element.relativePath.pathString) + } + // Don't check under the project's build folder. exclude project.buildDir.name diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java index 804575def141..06bd583fb71e 100644 --- a/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java +++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java @@ -208,41 +208,41 @@ public void testHybridQueryWithPagination() throws Exception { prepareIndexDocs(); String jsonQueryAll = """ - { - "queries": { - "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 5^1)"}}, - "lexical2": {"lucene": {"query": "id:(4^1 OR 5^2 OR 7^3 OR 10^2)"}} - }, - "fields": ["id", "score", "title"], - "params": {"combiner": true, "combiner.query": ["lexical1", "lexical2"]} - }"""; + { + "queries": { + "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 5^1)"}}, + "lexical2": {"lucene": {"query": "id:(4^1 OR 5^2 OR 7^3 OR 10^2)"}} + }, + "fields": ["id", "score", "title"], + "params": {"combiner": true, "combiner.query": ["lexical1", "lexical2"]} + }"""; QueryResponse rsp = query(CommonParams.JSON, jsonQueryAll, CommonParams.QT, "/search"); assertFieldValues(rsp.getResults(), id, "5", "7", "2", "6", "3", "10", "4"); String jsonQueryLimit4 = """ - { - "queries": { - "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 5^1)"}}, - "lexical2": {"lucene": {"query": "id:(4^1 OR 5^2 OR 7^3 OR 10^2)"}} - }, - "limit": 4, - "fields": ["id", "score", "title"], - "params": {"combiner": true, "combiner.query": ["lexical1", "lexical2"]} - }"""; + { + "queries": { + "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 5^1)"}}, + "lexical2": {"lucene": {"query": "id:(4^1 OR 5^2 OR 7^3 OR 10^2)"}} + }, + "limit": 4, + "fields": ["id", "score", "title"], + "params": {"combiner": true, "combiner.query": ["lexical1", "lexical2"]} + }"""; rsp = query(CommonParams.JSON, jsonQueryLimit4, CommonParams.QT, "/search"); assertFieldValues(rsp.getResults(), id, "5", "7", "2", "6"); String jsonQueryPage = """ - { - "queries": { - "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 5^1)"}}, - "lexical2": {"lucene": {"query": "id:(4^1 OR 5^2 OR 7^3 OR 10^2)"}} - }, - "limit": 4, - "offset": 3, - "fields": ["id", "score", "title"], - "params": {"combiner": true, "combiner.query": ["lexical1", "lexical2"]} - }"""; + { + "queries": { + "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 5^1)"}}, + "lexical2": {"lucene": {"query": "id:(4^1 OR 5^2 OR 7^3 OR 10^2)"}} + }, + "limit": 4, + "offset": 3, + "fields": ["id", "score", "title"], + "params": {"combiner": true, "combiner.query": ["lexical1", "lexical2"]} + }"""; rsp = query(CommonParams.JSON, jsonQueryPage, CommonParams.QT, "/search"); assertEquals(4, rsp.getResults().size()); assertFieldValues(rsp.getResults(), id, "6", "3", "10", "4"); @@ -259,21 +259,21 @@ public void testQueryWithFaceting() throws Exception { prepareIndexDocs(); String jsonQuery = """ - { - "queries": { - "lexical": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 5^1)"}} - }, - "limit": 3, - "offset": 1, - "fields": ["id", "score", "title"], - "params": { - "combiner": true, - "facet": true, - "facet.field": "mod3_idv", - "facet.mincount": 1, - "combiner.query": ["lexical"] - } - }"""; + { + "queries": { + "lexical": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 5^1)"}} + }, + "limit": 3, + "offset": 1, + "fields": ["id", "score", "title"], + "params": { + "combiner": true, + "facet": true, + "facet.field": "mod3_idv", + "facet.mincount": 1, + "combiner.query": ["lexical"] + } + }"""; QueryResponse rsp = query(CommonParams.JSON, jsonQuery, CommonParams.QT, "/search"); assertEquals(3, rsp.getResults().size()); assertEquals(4, rsp.getResults().getNumFound()); From aa18c5db64b91999d3e145c0e5488824b43b2895 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Fri, 5 Jun 2026 01:15:15 +0200 Subject: [PATCH 20/22] Combine tests for multiple query execution, --- ...DistributedCombinedQueryComponentTest.java | 40 ------------------- 1 file changed, 40 deletions(-) diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java index 06bd583fb71e..e42a5d10a2b8 100644 --- a/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java +++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java @@ -169,17 +169,7 @@ public void testCombinedQueries() throws Exception { QueryResponse rsp = query(CommonParams.JSON, jsonQuery, CommonParams.QT, "/search"); assertEquals(5, rsp.getResults().size()); assertFieldValues(rsp.getResults(), id, "5", "7", "2", "6", "3"); - } - /** - * Test multiple query execution with sort. - * - * @throws Exception the exception - */ - @Test - @ShardsFixed(num = 2) - public void testMultipleQueryWithSort() throws Exception { - prepareIndexDocs(); String jsonQuery = """ { @@ -195,17 +185,7 @@ public void testMultipleQueryWithSort() throws Exception { QueryResponse rsp = query(CommonParams.JSON, jsonQuery, CommonParams.QT, "/search"); assertEquals(5, rsp.getResults().size()); assertFieldValues(rsp.getResults(), id, "5", "2", "7", "10", "4"); - } - /** - * Tests the hybrid query functionality of the system with various setting of pagination. - * - * @throws Exception if any unexpected error occurs during the test execution. - */ - @Test - @ShardsFixed(num = 2) - public void testHybridQueryWithPagination() throws Exception { - prepareIndexDocs(); String jsonQueryAll = """ { @@ -246,17 +226,7 @@ public void testHybridQueryWithPagination() throws Exception { rsp = query(CommonParams.JSON, jsonQueryPage, CommonParams.QT, "/search"); assertEquals(4, rsp.getResults().size()); assertFieldValues(rsp.getResults(), id, "6", "3", "10", "4"); - } - /** - * Tests the single query functionality with faceting only. - * - * @throws Exception if any unexpected error occurs during the test execution. - */ - @Test - @ShardsFixed(num = 2) - public void testQueryWithFaceting() throws Exception { - prepareIndexDocs(); String jsonQuery = """ { @@ -278,17 +248,7 @@ public void testQueryWithFaceting() throws Exception { assertEquals(3, rsp.getResults().size()); assertEquals(4, rsp.getResults().getNumFound()); assertEquals("[0 (2), 2 (2)]", rsp.getFacetFields().getFirst().getValues().toString()); - } - /** - * Tests the combined query feature with faceting and highlighting. - * - * @throws Exception if any unexpected error occurs during the test execution. - */ - @Test - @ShardsFixed(num = 2) - public void testQueriesWithFacetAndHighlights() throws Exception { - prepareIndexDocs(); String jsonQuery = """ { From c0cd6707ee663944ab949af73015955bb30e3f64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Fri, 5 Jun 2026 01:20:37 +0200 Subject: [PATCH 21/22] Merge six tests into one to save startup and indexing cost --- ...DistributedCombinedQueryComponentTest.java | 201 ++++++++++-------- 1 file changed, 112 insertions(+), 89 deletions(-) diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java index e42a5d10a2b8..2faac4067541 100644 --- a/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java +++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedCombinedQueryComponentTest.java @@ -109,30 +109,6 @@ private void prepareIndexDocs() throws Exception { commit(); } - /** - * Tests a single lexical query against the Solr server using both combiner methods. - * - * @throws Exception if any exception occurs during the test execution - */ - @Test - @ShardsFixed(num = 2) - public void testSingleLexicalQuery() throws Exception { - prepareIndexDocs(); - String jsonQuery = - """ - { - "queries": { - "lexical1": {"lucene": {"query": "id:2^10"}} - }, - "limit": 5, - "fields": ["id", "score", "title"], - "params": {"combiner": true, "combiner.query": ["lexical1"]} - }"""; - QueryResponse rsp = query(CommonParams.JSON, jsonQuery, CommonParams.QT, "/search"); - assertEquals(1, rsp.getResults().size()); - assertFieldValues(rsp.getResults(), id, "2"); - } - @Override protected String getShardsString() { if (deadServers == null) return shards; @@ -146,48 +122,76 @@ protected String getShardsString() { } /** - * Tests all combined query variants (single lexical, multiple lexical, sort, pagination, - * faceting, facet+highlighting) against the same 10-document index. - * - * @throws Exception if any error occurs during the test execution + * Tests combined query functionality: single and multiple lexical queries, sorting, pagination, + * faceting, and highlighting. Merged into one test for efficiency. */ @Test @ShardsFixed(num = 2) public void testCombinedQueries() throws Exception { prepareIndexDocs(); - String jsonQuery = - """ - { - "queries": { - "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 5^1)"}}, - "lexical2": {"lucene": {"query": "id:(4^1 OR 5^2 OR 7^3 OR 10^2)"}} - }, - "limit": 5, - "fields": ["id", "score", "title"], - "params": {"combiner": true, "combiner.query": ["lexical1", "lexical2"]} - }"""; - QueryResponse rsp = query(CommonParams.JSON, jsonQuery, CommonParams.QT, "/search"); + + // Single lexical query + QueryResponse rsp = + query( + CommonParams.JSON, + """ + { + "queries": { + "lexical1": {"lucene": {"query": "id:2^10"}} + }, + "limit": 5, + "fields": ["id", "score", "title"], + "params": {"combiner": true, "combiner.query": ["lexical1"]} + }""", + CommonParams.QT, + "/search"); + assertEquals(1, rsp.getResults().size()); + assertFieldValues(rsp.getResults(), id, "2"); + + // Multiple lexical queries + rsp = + query( + CommonParams.JSON, + """ + { + "queries": { + "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 5^1)"}}, + "lexical2": {"lucene": {"query": "id:(4^1 OR 5^2 OR 7^3 OR 10^2)"}} + }, + "limit": 5, + "fields": ["id", "score", "title"], + "params": {"combiner": true, "combiner.query": ["lexical1", "lexical2"]} + }""", + CommonParams.QT, + "/search"); assertEquals(5, rsp.getResults().size()); assertFieldValues(rsp.getResults(), id, "5", "7", "2", "6", "3"); - String jsonQuery = - """ - { - "queries": { - "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 5^1)"}}, - "lexical2": {"lucene": {"query": "id:(4^1 OR 5^2 OR 7^3 OR 10^2)"}} - }, - "limit": 5, - "sort": "mod3_idv desc, score desc", - "fields": ["id", "score", "title"], - "params": {"combiner": true, "combiner.query": ["lexical1", "lexical2"]} - }"""; - QueryResponse rsp = query(CommonParams.JSON, jsonQuery, CommonParams.QT, "/search"); + // Multiple queries with sort + rsp = + query( + CommonParams.JSON, + """ + { + "queries": { + "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 5^1)"}}, + "lexical2": {"lucene": {"query": "id:(4^1 OR 5^2 OR 7^3 OR 10^2)"}} + }, + "limit": 5, + "sort": "mod3_idv desc, score desc", + "fields": ["id", "score", "title"], + "params": {"combiner": true, "combiner.query": ["lexical1", "lexical2"]} + }""", + CommonParams.QT, + "/search"); assertEquals(5, rsp.getResults().size()); assertFieldValues(rsp.getResults(), id, "5", "2", "7", "10", "4"); - String jsonQueryAll = - """ + // Pagination: no limit (all results) + rsp = + query( + CommonParams.JSON, + """ { "queries": { "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 5^1)"}}, @@ -195,11 +199,16 @@ public void testCombinedQueries() throws Exception { }, "fields": ["id", "score", "title"], "params": {"combiner": true, "combiner.query": ["lexical1", "lexical2"]} - }"""; - QueryResponse rsp = query(CommonParams.JSON, jsonQueryAll, CommonParams.QT, "/search"); + }""", + CommonParams.QT, + "/search"); assertFieldValues(rsp.getResults(), id, "5", "7", "2", "6", "3", "10", "4"); - String jsonQueryLimit4 = - """ + + // Pagination: limit 4 + rsp = + query( + CommonParams.JSON, + """ { "queries": { "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 5^1)"}}, @@ -208,11 +217,16 @@ public void testCombinedQueries() throws Exception { "limit": 4, "fields": ["id", "score", "title"], "params": {"combiner": true, "combiner.query": ["lexical1", "lexical2"]} - }"""; - rsp = query(CommonParams.JSON, jsonQueryLimit4, CommonParams.QT, "/search"); + }""", + CommonParams.QT, + "/search"); assertFieldValues(rsp.getResults(), id, "5", "7", "2", "6"); - String jsonQueryPage = - """ + + // Pagination: limit 4, offset 3 + rsp = + query( + CommonParams.JSON, + """ { "queries": { "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 5^1)"}}, @@ -222,13 +236,17 @@ public void testCombinedQueries() throws Exception { "offset": 3, "fields": ["id", "score", "title"], "params": {"combiner": true, "combiner.query": ["lexical1", "lexical2"]} - }"""; - rsp = query(CommonParams.JSON, jsonQueryPage, CommonParams.QT, "/search"); + }""", + CommonParams.QT, + "/search"); assertEquals(4, rsp.getResults().size()); assertFieldValues(rsp.getResults(), id, "6", "3", "10", "4"); - String jsonQuery = - """ + // Faceting + rsp = + query( + CommonParams.JSON, + """ { "queries": { "lexical": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 5^1)"}} @@ -243,32 +261,37 @@ public void testCombinedQueries() throws Exception { "facet.mincount": 1, "combiner.query": ["lexical"] } - }"""; - QueryResponse rsp = query(CommonParams.JSON, jsonQuery, CommonParams.QT, "/search"); + }""", + CommonParams.QT, + "/search"); assertEquals(3, rsp.getResults().size()); assertEquals(4, rsp.getResults().getNumFound()); assertEquals("[0 (2), 2 (2)]", rsp.getFacetFields().getFirst().getValues().toString()); - String jsonQuery = - """ - { - "queries": { - "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 5^1)"}}, - "lexical2": {"lucene": {"query": "id:(4^1 OR 5^2 OR 7^3 OR 10^2)"}} - }, - "limit": 4, - "fields": ["id", "score", "title"], - "params": { - "combiner": true, - "facet": true, - "facet.field": "mod3_idv", - "combiner.query": ["lexical1", "lexical2"], - "hl": true, - "hl.fl": "title", - "hl.q": "test doc" - } - }"""; - QueryResponse rsp = query(CommonParams.JSON, jsonQuery, CommonParams.QT, "/search"); + // Faceting + highlighting + rsp = + query( + CommonParams.JSON, + """ + { + "queries": { + "lexical1": {"lucene": {"query": "id:(2^2 OR 3^1 OR 6^2 OR 5^1)"}}, + "lexical2": {"lucene": {"query": "id:(4^1 OR 5^2 OR 7^3 OR 10^2)"}} + }, + "limit": 4, + "fields": ["id", "score", "title"], + "params": { + "combiner": true, + "facet": true, + "facet.field": "mod3_idv", + "combiner.query": ["lexical1", "lexical2"], + "hl": true, + "hl.fl": "title", + "hl.q": "test doc" + } + }""", + CommonParams.QT, + "/search"); assertEquals(4, rsp.getResults().size()); assertFieldValues(rsp.getResults(), id, "5", "7", "2", "6"); assertEquals("mod3_idv", rsp.getFacetFields().getFirst().getName()); From c6e28c263761902dd7755286fd5fb229ed2ae9c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Fri, 5 Jun 2026 02:34:03 +0200 Subject: [PATCH 22/22] Revert RAT changes --- gradle/validation/rat-sources.gradle | 6 ------ 1 file changed, 6 deletions(-) diff --git a/gradle/validation/rat-sources.gradle b/gradle/validation/rat-sources.gradle index 49e948bc78e3..f8556d2ffa4f 100644 --- a/gradle/validation/rat-sources.gradle +++ b/gradle/validation/rat-sources.gradle @@ -35,12 +35,6 @@ allprojects { description = 'Runs Apache Rat checks.' def defaultScanFileTree = project.fileTree(projectDir, { - // Only check files tracked by git — skip .gitignore-d files (IDE artifacts, AI assistant configs, etc.) - def trackedFiles = ["git", "ls-files", "--cached"].execute(null, projectDir).text.trim().split("\n").toList().toSet() - exclude { element -> - !element.isDirectory() && !trackedFiles.contains(element.relativePath.pathString) - } - // Don't check under the project's build folder. exclude project.buildDir.name