Problem configuring SearchSolr module

Hi,

I have just upgraded to version 2.1.2 of Omeka-s (while waiting for the future V3) and I took the opportunity to upgrade the modules we use, in particular “Search 3.5.15” and “SearchSolr 3.5.15”. The latter is based on the Solarium library, which I installed under the SearchSolr directory.

I was able to install both modules. But when I want to configure SearchSolr, I get the following error:

Argument 1 passed to Solarium\Core\Client\Client::__construct() must be an instance of Solarium\Core\Client\Adapter\AdapterInterface, array given, called in /applis/omeka/home/www/omeka-s/modules/SearchSolr/src/Api/Representation/SolrCoreRepresentation.php on line 137

Détails :
TypeError: Argument 1 passed to Solarium\Core\Client\Client::__construct() must be an instance of Solarium\Core\Client\Adapter\AdapterInterface, array given, called in /applis/omeka/home/www/omeka-s/modules/SearchSolr/src/Api/Representation/SolrCoreRepresentation.php on line 137 and defined in /applis/omeka/home/www/omeka-s/modules/SearchSolr/vendor/solarium/solarium/src/Core/Client/Client.php:270

Does anyone have any ideas ?

Thank you in advance

Hi,
The point to use the Solarium library is to avoid the php-solr extension, that is not always installed on servers and that is often late to integrate new improvements of solr.
The release includes it, but if you use it, it is installed via composer install command.

So it seems that you installed Solarium version 6, but the module still requires version 5 of the library. So remove the directory vendor and don’t use composer update.

Thank you for the answer.

Indeed I had installed the V6 of Solarium.

I deleted the “vendor” directory like indicated and ran the “compose install” command.

Except that the Solarium version indicated in the composer files is V6.

So I took the liberty of modifying them to indicate to take the Solarium V5.

And the command “compose install” indicates among others the following line :

  • Installing solarium/solarium (5.0.0): Loading from cache

I uninstalled and then installed again the module and the problem remains the same.

In the release, I use version 5.2. I didn’t check 5.0.

I’ve just modified the composer files again to indicate to take the solarium V5.2.

And I launch the compose install command again and it indicates the following line :

  • Installing solarium/solarium (5.2.0): Loading from cache

But, unfortunately, the problem remains

Can I rely on what the command indicates or and where can I verify that it’s solarium version 5.2 that has been loaded ?

So it’s strange. The version is in the file vendor/solarium/solarium/src/Client.php, but normally, it is the same than the composer one. Else, the zipped release contains a version with it.

The command composer does not look good, because in the file “Client.php” you find :
const VERSION = ‘6.0.0’;

I just retrieved and installed the zipped release and the problem is solved.
Thanks a lot.