Search code examples
magentosolrezpublish

Using Solr on multiple CMS


I have an eZ Publish and a Magento site on two different servers, and one Solr server. The Solr server is now used as the search engine for eZ Publish but I would also like to use the same Solr-server on Magento.

eZ Publish comes with an extension (eZFind) which contains schema.xml, and I got it working straight of the box without any configuration (other than defining the Solr-server, user, password, etc).

Magento ships with a schema.xml and solrconfig.xml, which according the documentation needs to be copied to the Solr-server.

I'm a bit afraid of doing this since I don't want to break the search on eZ Publish.

Does anyone have any experience with this or has any recommendations on the Solr setup?


Solution

  • You need to use the multi-core feature of Solr (see there) so that you will only have one Solr instance, serving 2 cores (at least). What does that mean ? Each core will be defined by at least 2 files (schema.xml and solrconfig.xml), which will be located in dedicated folders within your Solr installation. Then the cores have to be registered in a file named solr.xml which, in your case, could look like this :

    <?xml version="1.0" encoding="UTF-8" ?>
    <solr persistent="true" sharedLib="lib">
        <cores adminPath="/admin/cores">
             <core name="ezpublish" instanceDir="ezpublish" />
             <core name="magento" instanceDir="magento" />
        </cores>
    </solr>
    

    If your current solr installation is still in the eZ Find extension, then you should have a look a this page which tells you how to move the bundled Solr installation outside of eZ Publish. Then, add a new core with the Magenta configuration files.

    Depending on the Solr version you are using, I would recommend installing Solr on your own (without taking the one for eZ Find) and apply the eZ Publish configuration on it.