following the php documentation I wanted to use their SOLR swap function, but it is not working as expected. The script throws no error, but the cores are not swapped. The same is true for action rename, no error, nothing happens.
I’ve checked SOLR and PHP logs, but no errors are logged and the cores are not swapped. Swapping with the SOLR UI is working fine, the connection to the cores is also working fine. Any ideas are much appreciated.
Here is my code
// create a client instance
$client = new SolariumClient($adapter, $eventDispatcher, $config);
// create a CoreAdmin query
$coreAdminQuery = $client->createCoreAdmin();
// use the CoreAdmin query to build a Swap action
$swapAction = $coreAdminQuery->createSwap();
$swapAction->setCore('core1');
$swapAction->setOther('core2');
$coreAdminQuery->setAction($swapAction);
$query = $client->createSelect();
$query->setQuery('*:*');
$resultset = $client->select($query);
echo "Records in core1": $resultset->getNumFound(); //shows not the expected new number, but the old one
Gabi Droege is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.