eZ Find extension in finder

Alright, so lets begin installing eZ Find by going out and downloading it from the Github => https://github.com/ezsystems/ezfind. eZ Find is an eZ Publish extension so: unzip the download, rename the fold ”ezfind,” and then move the ezfind folder to the extensions directory of your eZ Publish install.

So, as with any extension, we have to activate it. Go into your override site.ini.append.php (settings/override/site.ini.append.php) and add ezfind to your active extension list (ActiveExtensions[]=ezfind). I added mine just after my main site extension. Easy enough so far right?

Solr installed locally

As you had probably already guessed, eZ Find will not without first setting up Solr. Luckily eZ Find comes with the recommended version of Solr for eZ Find. Within the eZ Find extension you should see a java directory (remember Solr is written in Java?). So what we need to do is copy the java directory and move it to the htdocs level of your eZ Publish install and rename the folder “Solr” (see the image on the right). There is a lot in the solr directory that we will not need to mess with right now, specifically I will not cover the multicore options right now, just know that eZ Find can run multiple sites/cores on one Solr install. Also note that I just installed Solr locally, but it can also be installed on remote servers.

Now that we have Solr installed we need to start it. Just open up terminal, navigate to your Solr install and from that directory run the following command.

java -Dezfind -jar start.jar

Eventually you want to have a job run Solr in the background, but for now running it in your console is more than satisfactory, plus it helps during development to see errors pop-up from time to time.

Next step, we need to create two files within our main site settings folder:

  • ezfind.ini.append.php
  • solr.ini.append.php

The ezfind ini can be left blank for now. Just know that you can modify a lot of eZ Find settings from within that ini. The solr ini however must edited now in order for search to work properly. Add the following lines to your Solr ini:

[SolrBase]
# Base URI of the Solr server
SearchServerURI=http://localhost:8983/solr

The localhost search server is actually already in the default solr ini file but I like to make sure I am controlling this by putting the line in my own ini file. Also, should your solr server be anything other than local, just change it’s location here.

So, we have eZ Find installed and activated, Solr installed and started, now all we need is an index to search. eZ Find comes with a nice script for updating the search index already so we just need to run it (run the command from the root install level just like you would the clear-cache script). Run the following script:

php extension/ezfind/bin/php/updatesearchindexsolr.php -s <admin siteaccess> --php-exec=php --conc=2

The script is pretty advanced. You need to specify the admin version of your siteaccess, mine would be harmssite_admin. You need to specify the number of cores to use, my local computer is a quad-core so I set typically conc=4. Setting the php-exec is optional. There is another optional parameter to send, clean or clean-all. Clean will clean the index of any prior content before updating it (i recommend using clean when developing). Clean-all is only used when you have multiple Solr cores going and you want to clean them all at once, I don’t use clean-all often.

Updating the Solr index with eZ Find

Assuming everything went well you should have seen something similar to my screencap when updating the index.

Don’t worry if it didn’t work at first, just keep with it. Also, leave me a comment and I will respond.

Hope you enjoyed the post, I will try and do a post about a multi-core install sometime soon.