Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

Using multi-core features

As mentioned before, you are able to set up a single Solr instance, the backend engine of eZ Find, to serve multiple sites (it does not even matter if these are on the same box). Similar to a database, Solr is capable of having multiple search indexes from one servlet, because Solr supports the concepts of multiple "cores". This means that it can run multiple instances of itself inside a servlet container. Each core has its own set of configuration files (including the "schema") and dedicated directories.

Lets go through the steps of setting up a Solr instance which must serve two sites. To keep it simple we'll call them ezlabs .no and ez.no.

  1. The easiest way is to first prepare a central location for the Solr Index. This can for example be:

    /srv/solr
    
  2.  Next you should create two additional directories inside it, as follows:
    /srv/solr/java
    /srv/solr/cores
    
  3.  Inside /srv/solr/java you should store a copy of the contents of the java directory of your eZ Find installation, or if you don't have one yet, download it from http://share.ez.no/downloads.
    Note: Enterprise customers can download from the download page in the Service Portal 
  4.  Next create a symlink for the solr/lib plugin directory inside /srv/solr/cores like this:
    ln -s /srv/solr/java/solr/lib /srv/solr/cores
    
  5.  Create additional directories for each of your sites, called ezlabs and ez in your /srv/solr/cores. Both of them must contain a data and a conf sub-directory.
     Your file structure should look something like this:
    /srv/solr/cores
           ezlabsno/data
           ezlabsno/conf
     
           ezno/data
           ezno/conf
    
  6.  In both conf directories you must then copy the contents of the folder extension/ezfind/java/solr/conf/* and adapt the Solr dataDir.
  7.  Next create a solr.xml file inside /srv/solr/cores/solr.xml with the following content:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!-- snip the comments from Apache wiki -->
    <solr persistent="true" sharedLib="lib">
        <cores adminPath="/admin/cores">
             <core name="ezlabsno" instanceDir="ezlabsno" />
             <core name="ezno" instanceDir="ezno" />
        </cores>
    </solr>
    
  8.  If you already have indexed data for one or both of your sites, you may stop Solr from indexing them again. You should then copy the index and spellchecker directories to your data directories (in /srv/solr/cores/ezlabsno/data and /srv/solr/cores/ezno/data).
  9.  Now you should restart Solr with the following parameters:
    cd /srv/solr/java; java -Dsolr.solr.home=/srv/solr/cores -jar start.jar
    
  10.  It's important to keep an eye on the output, in case of potential errors (for example things that are permission related).
  11.  And finally you can configure the individual eZ Publish and eZ Find instances with the dedicated  URLs as base URLs in solr.ini:
http://localhost:8983/solr/ezlabsno
 
http://localhost:8983/solr/ezno

Ricardo Correia (05/02/2013 12:18 pm)

Ricardo Correia (14/02/2013 9:58 am)


Comments

There are no comments.