This guide will teach you how to replace your slow and inaccurate WordPress search with WPSolr search. WPSolr works with external search engines to deliver the fastest and most relevant search possible.
This guide explains how to setup your search with Elasticsearch. But it works the same for any of our other compatible search engines with very minor differences.
Install Elasticsearch
Install Elasticsearch locally in a docker container
To learn how to install Elasticsearch locally, you should follow our guide.
Create a Elastic cloud instance
If you wish, WPSolr allows you to add Elasticsearch (or any other search engine’s) cloud-hosted solution to your WordPress using a few providers. However this feature isn’t available in WPSolr free.
Install the WPSolr Free plugin
In the WordPress plugins page, click on the Add New Plugin.
Click on the field Search Plugins, then enter WPSolr.
Click on the install and activate buttons for the WPSolr plugin.
Open the WPSolr Free dashboard.
Create your index
This portion will you how to create your index on your locally installed Elasticsearch server. If you wish to learn how to create an Elasticsearch index on your cloud-hosted server, you could check out our guide.
Open the indexes tab in the WPSolr dashboard.
Create a new index.
Select the local Elasticsearch index and set it’s name that will appear in the WPSolr dashboard.
Set the name of the index that will appear in the Elasticsearch backend.
Set the Elasticsearch index hostname (the service name in your docker-compose file). In this case it’s “elasticsearch”. Don’t forget that this is from the perspective of the WordPress container, not your host machine so localhost wouldn’t work.
Set the Elasticsearch server port.
You can now save your index.
After creating your index, you can click on “2. Define your search” tab.
Index data
Click on the “2.2 Data” tab.
Select the data types to index.
Click on the “3. Send your data” tab.
Index the selected data.
Configure your search
Click on the “2. Define your search” tab.
Select you created index (in this case “local_elasticsearch”).
Select the archives to replace with WPSolr search.
Since you have selected “Search archive”, it should now be used whenever your use a search bar.