Donate to support Ukraine's independence.

Solr, WordPress & OSX Server

I have long been a fan of WordPress and not so much a fan of the search engine functionality that comes boxed with it. As an Apple Systems Admin I have several WordPress websites running on several OSX Servers. One of the sites that I administer finally got to the size to where the search capabilities of WordPress fell short of the clients desire and I was forced to look into other avenues for searching. I came across, solar. Solr is an open source enterprise search server based on the Lucene Java search library, with XML/HTTP and JSON APIs, hit highlighting, faceted search, caching, replication, and a web administration interface. This looked extremely promising however getting all of the information that I needed in order to get this running on my servers proved to be a cumbersome process, so I am now writing this to consolidate all of the steps and information that I learned while installing and getting Solr to run on our servers.

The first step is to download all of the needed files, download the most recent version of Solr, and the Solr for WordPress plugin. The first part of the documentation here will be on how to install and get Solr running and then the second portion will focus on configuring the Solr for WordPress plugin. For this walkthrough I will be using the example application that comes with Solr. ** Before we proceed you need to open the port 8983 in your servers firewall and or hardware firewall appliance for public access.

  1. Expand the Solr archive into a folder in the Applications folder called Solr (/Applications/Solr)

  2. For testing and development we can use the example application coming with Solr. This application is found at /Applications/Solr/example.

  3. Move the schema.xml that comes with the Solr for WordPress in the folder* /Applications/Solr/example/solr/conf/* (add “.backup” to the original file).

Now start the solr application by opening the Terminal and executing the command:

cd /Applications/Solr/example/

java -jar start.jar

Test that your solr server is now available by visiting https://localhost:8983/solr/admin/

now that you have Solr running on your osx server, you need to make sure that it will run in the background even when you logout of the computer. At the moment it is running through Java and when you logout it will stop running. In order to accomplish this you need to create a LaunchD item, this item needs to be placed in the /Library/LaunchDaemons/ folder.

  1. Create a new text file name it org.apache.solr.plist

  2. Enter the following information into the file

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN >
<plist version="1.0">
      <true />

Once done, place this file in the /Library/LaunchDaemons/ folder and then run this command in terminal

sudo launchctl load /Library/LaunchDaemons/org.apache.solr.plist

this will load the Launch Daemon when the computer restarts, the next step is to restart your server and then make sure that Solr is running by going to the Solr admin URL https://localhost:8983/solr/admin/ or

Now that you have Solr running on the server, and the schema file loaded then you need to make sure that the Solr for WordPress plugin is installed. Note: Solr, does not need to run on the same server as your wordpress install, we have a dedicated Mac Mini server running Solr and it works great. To install Solr for WordPress follow these steps.

  1. Upload the solr-for-wordpress folder to the /wp-content/plugins/ directory

  2. Activate the plugin through the ‘Plugins’ menu in WordPress

  3. Configure the plugin with the hostname, port, and URI path to your Solr installation.

  4. Load all your posts and/or pages via the “Load All Posts” button in the settings page

Note that this plugin requires you to have an instance of Solr using a schema with the following fields: id, permalink, title, content, numcomments, categories, categoriessrch, tags, tagssrch, author, type, and text. The facet fields (categories, tags, author, and type) should be string fields. You can make tagssrch and categoriessrch of any type you want as they are used for general searching. The plugin is distributed with a Solr schema you can use at solr-for-wordpress/schema.xml.

Now that the plugin is installed and active, login to the administrative area of your WordPress website and go to the “Settings –> Solr Options” area. Once here enter the IP address or Fully Qualified Domain that is running solar. Enter the Port, which in this document is 8983 and enter /solr for the path. Once done, press “Save Changes” it will test the connection to the server and will let you know if it can connect or not.

Once you have gotten the plugin to connect you can “Load All Pages” and “Load All Posts” to build your initial Solr database. Your almost complete now you need to integrate the search results that you get from the Solr server into your WordPress website.

Custom Theme Integration

  1. Create a new theme file called “s4w_search.php”.

  2. Insert your markup, use template methods s4w_search_form() and s4w_search_results() to insert the search box and results respectively.

  3. Add result styling to your theme css file, see solr-for-wordpress/template/search.css for an example.

  4. You can use the search widget in your sidebar for search, or use a custom search box that submits the query in the parameter “s”.

For more information about integrating Solr into your WordPress website you can go to

I certainly welcome your feedback so if you have an questions or comments feel free to post them below.

Are You Getting Quality Mac Support From Your PC MSP?

We have assisted many businesses in implementing MDMs, developing custom security policies and procedures, and redesigning their networks.The list goes on and on. Contact us today and see how we can help you too.

Contact Sales

Drop us a line.

We are a remote and fully distributed, Nationwide Apple focused MSP serving Washington DC, Philadelphia, New York, Chicago, San Francisco, San Diego & more.

We focus on providing top notch Mac Support for small to mid-sized businesses. Contact us, and learn how we can help your company.

Full Name
Your email address
Phone Number
Company Name
How many Mac's & PC's do you have?
How many employees do you have?
Where are you located?
What challenges are you facing?

© Grove Technologies is a registered service mark trademark of Grove Technologies. Privacy Policy | Terms of Service. Cookie Preferences