Skip to content

Commit 7368bf3

Browse files
committed
[FEATURE] Search: Allow to set the solrConnection used
Since Tx_Solr_Search is a t3lib_Singleton we need a set-method to be able to switch connections/cores during the same request. Change-Id: Ife97d988202b49e99a22f905def32d73a6718a90 Resolves: #64484 Releases: master Reviewed-on: http://review.typo3.org/36238 Reviewed-by: Stefan Neufeind <[email protected]> Tested-by: Stefan Neufeind <[email protected]>
1 parent 6ad23a8 commit 7368bf3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Classes/Search.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,17 @@ public function getSolrConnection() {
8989
return $this->solr;
9090
}
9191

92+
/**
93+
* Sets the Solr connection used by this search.
94+
*
95+
* Since Tx_Solr_Search is a t3lib_Singleton, this is needed to
96+
* be able to switch between multiple cores/connections during
97+
* one request
98+
*/
99+
public function setSolrConnection(Tx_Solr_SolrService $solrConnection) {
100+
$this->solr = $solrConnection;
101+
}
102+
92103
/**
93104
* Executes a query against a Solr server.
94105
*

0 commit comments

Comments
 (0)