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

Solr backend

eZ Find uses the Open Source enterprise search server Solr, which runs on the Lucene Java search library. While the default search function in eZ Publish stores the search index in the database, Solr uses its own highly optimized file for storing its index.

Solr handles the indexing and searching with an eZ Publish-specific set of configuration files. While indexing, eZ Find uses this specific configuration to do index and query-time analysis of text and keywords. When users perform searches, eZ Find generates a Solr search query based on the user input that is submitted to the Solr back end. All communication with Solr is done via Web services (using the REST model).

Solr Index location

Solr will store the search index according to the directives in the configuration file. You can easily change the index path for your installation as follows:
Go to extension/ezfind/java/solr/conf/solrconfig.xml in your eZ Publish folder and locate

<dataDir>${solr.data.dir:/ezfind/java/solr/data}</dataDir>

Here you can change the input to match your preferred location. But make sure the permissions are set correctly.

Start Solr

You can start Solr direct or as a service.

Direct

To start Solr, navigat e to your eZ Publish extension/ezfind/java directory and run the command:

java -Dezfind -jar start.jar

If the Java process dies during indexing or searching, the memory limit (“heap space”) need to be increased. Specify as follows the heap space as start-up parameters to allocate a heap space of 512 MB:

java -Dezfind -Xms512M -Xmx512M -jar start.jar

The “-Dezfind” option makes it easier to identify the eZ Find Java process.
Make sure the user executing the Java program has write access to the folders extension/ezfind/java/solr/data and extension/ezfind/java/logs).

This will start the Solr application in the bundled servlet container (Jetty). This application must be running for the indexing and search operations to work. If you are working directly on the web server, you can verify that Solr is running by accessing the URL http://localhost:8983/solr/admin/, or replace “localhost” in the URL with the IP address of the server.

As a Service

eZ Find provides scripts for running eZ Find as a service on Linux platforms. The platforms supported are Debian and RedHat based distributions.

  • Redhat based Systems

Copy the file extension/ezfind/bin/scripts/redhat/solr to your /etc/init.d folder. Then edit the file and configure the required variables:

SOLR_HOME
Set this variable to the Java folder of the ezfind extension you want to run as a service.
Example: SOLR_HOME=/var/www/ezpublish/extension/ezfind/java

JAVA_HOME
If your java executable is not located in /usr/bin/java or /usr/local/bin/java and the JAVA_HOME environment variable is not set, you can specify the path to your java folder here.
Example: JAVA_HOME=/path/to/javafolder

  • Debian based systems

Copy the file extension/ezfind/bin/scripts/debian/solr to your /etc/init.d folder. You can then use update-rc.d to set solr as auto-start in the required run levels with the command:

$ update-rc.d solr defaults

Finally, edit the file and configure the required variables:

SOLR_HOME
Set this variable to the java folder of the eZ Find extension you want to run as a service.
Example: SOLR_HOME=/var/www/ezpublish/extension/ezfind/java.

For use by high performance and large sites

For large volumes and traffic (search takes about 30% of ez.no page requests), you will need to set up Solr in a similar way as the database engine (64 bit OS, 64 bit application/service).
Just like MySQL needs to scale up its InnoDB pool size beyond 2GB, so does eZ Find/Solr, although it usually works fine with less RAM. It is all about adjusting Java VM parameters.
If you don't have a 64 bit OS for your server, try the following:

java -server -Xmx600m -Xms600m -XX:+UseParallelGC -XX:+AggressiveOpts -XX:NewRatio=5 -jar start.jar

If you do have a 64 bit OS, use a 64 bit Sun JRE (1.5 for Linux, 1.6 for Solaris/Windows/Mac OS X) as follows:

java -server -d64 -Xmx600m -Xms600m -XX:+UseParallelGC -XX:+AggressiveOpts -XX:NewRatio=5 -jar start.jar

SearchHandler

The default search handler can be configured by default in ezfind.ini or specified with the dedicated eZ Find template search function. The default search handler is heuristic, but all options are listed below:

Setting

Description

standard

The Solr standard handler is called with all syntax supported, searching is done against all searchable fields

simplestandard

the Solr standard handler is called with all all syntax supported, searching is done against the aggregated field ezf_df_text

ezpublish

the recommended handler (Solr dismax based) for typical user searches using keywords without Boolean or other operators (prefixes + and – are supported)

heuristic

depending on the presence of special characters indicating Boolean, wildcard or fuzzy expressions, either the simplestandard or dismax handler is called

Geir Arne Waaler (06/06/2011 1:23 pm)

Geir Arne Waaler (06/06/2011 1:23 pm)


Comments

There are no comments.