@@ -1529,11 +1529,11 @@ public function providerForTestFind()
15291529 ],
15301530 [
15311531 self ::SETUP_DEDICATED => [
1532- 'searchHitIndex ' => 2 ,
1532+ 'searchHitIndex ' => 1 ,
15331533 'preparedDataTestIndex ' => 2 ,
15341534 ],
15351535 self ::SETUP_SHARED => [
1536- 'searchHitIndex ' => 2 ,
1536+ 'searchHitIndex ' => 1 ,
15371537 'preparedDataTestIndex ' => 2 ,
15381538 ],
15391539 self ::SETUP_SINGLE => [
@@ -1557,11 +1557,11 @@ public function providerForTestFind()
15571557 ],
15581558 [
15591559 self ::SETUP_DEDICATED => [
1560- 'searchHitIndex ' => 1 ,
1560+ 'searchHitIndex ' => 2 ,
15611561 'preparedDataTestIndex ' => 2 ,
15621562 ],
15631563 self ::SETUP_SHARED => [
1564- 'searchHitIndex ' => 1 ,
1564+ 'searchHitIndex ' => 2 ,
15651565 'preparedDataTestIndex ' => 2 ,
15661566 ],
15671567 self ::SETUP_SINGLE => [
@@ -1597,8 +1597,8 @@ public function providerForTestFind()
15971597 ],
15981598 [
15991599 self ::SETUP_DEDICATED => [
1600- 'searchHitIndex ' => 2 ,
1601- 'preparedDataTestIndex ' => 2 ,
1600+ 'searchHitIndex ' => 0 ,
1601+ 'preparedDataTestIndex ' => 1 ,
16021602 ],
16031603 self ::SETUP_SHARED => [
16041604 'searchHitIndex ' => 0 ,
@@ -1625,11 +1625,11 @@ public function providerForTestFind()
16251625 ],
16261626 [
16271627 self ::SETUP_DEDICATED => [
1628- 'searchHitIndex ' => 2 ,
1628+ 'searchHitIndex ' => 1 ,
16291629 'preparedDataTestIndex ' => 2 ,
16301630 ],
16311631 self ::SETUP_SHARED => [
1632- 'searchHitIndex ' => 2 ,
1632+ 'searchHitIndex ' => 1 ,
16331633 'preparedDataTestIndex ' => 2 ,
16341634 ],
16351635 self ::SETUP_SINGLE => [
@@ -1653,11 +1653,11 @@ public function providerForTestFind()
16531653 ],
16541654 [
16551655 self ::SETUP_DEDICATED => [
1656- 'searchHitIndex ' => 1 ,
1656+ 'searchHitIndex ' => 2 ,
16571657 'preparedDataTestIndex ' => 2 ,
16581658 ],
16591659 self ::SETUP_SHARED => [
1660- 'searchHitIndex ' => 1 ,
1660+ 'searchHitIndex ' => 2 ,
16611661 'preparedDataTestIndex ' => 2 ,
16621662 ],
16631663 self ::SETUP_SINGLE => [
@@ -1737,6 +1737,7 @@ public function testFindContent(
17371737 'filter ' => new Criterion \ContentTypeIdentifier ('test-type ' ),
17381738 'sortClauses ' => [
17391739 new SortClause \Field ('test-type ' , 'sort_field ' ),
1740+ new SortClause \Field ('test-type ' , 'search_field ' ),
17401741 ],
17411742 ];
17421743
@@ -1792,6 +1793,7 @@ public function testFindLocationsSingle(
17921793 ),
17931794 'sortClauses ' => [
17941795 new SortClause \Field ('test-type ' , 'sort_field ' ),
1796+ new SortClause \Field ('test-type ' , 'search_field ' ),
17951797 ],
17961798 ];
17971799
@@ -1843,6 +1845,7 @@ public function testFindLocationsMultiple(
18431845 'sortClauses ' => [
18441846 new SortClause \Location \Depth (Query::SORT_ASC ),
18451847 new SortClause \Field ('test-type ' , 'sort_field ' ),
1848+ new SortClause \Field ('test-type ' , 'search_field ' ),
18461849 ],
18471850 ];
18481851
@@ -1897,6 +1900,11 @@ public function testFindLocationsMultiple(
18971900 */
18981901 private function assertIndexName (array $ indexMap , SearchHit $ searchHit ): void
18991902 {
1903+ if (!$ this ->isSolrInMaxVersion ('9.3.0 ' )) {
1904+ // In Solr 9.3.0 and later, the shard parameter is not used anymore.
1905+ return ;
1906+ }
1907+
19001908 $ indexName = $ this ->getIndexName ($ indexMap );
19011909
19021910 if ($ indexName === null ) {
@@ -1930,4 +1938,14 @@ private function getIndexesToMatchData(
19301938
19311939 return $ indexesToMatchData ;
19321940 }
1941+
1942+ private function isSolrInMaxVersion (string $ maxVersion ): bool
1943+ {
1944+ $ version = getenv ('SOLR_VERSION ' );
1945+ if (is_string ($ version ) && !empty ($ version )) {
1946+ return version_compare ($ version , $ maxVersion , '< ' );
1947+ }
1948+
1949+ return false ;
1950+ }
19331951}
0 commit comments