The project involved development of an advanced search plugin, meant to replace the default WordPress search. The Apache Solr Server was used to provide fast search functionality and powerful search options.
What were the client’s requirements?
The client needed a search plugin, with search capabilities provided by Apache Solr Server. The entire plugin needed to be developed from scratch. The client wanted the following features to be provided:
- Fast search using Indexing
- Broad match search
- Highlighted search terms
- Faceted search based on taxonomies and post types
- Autocomplete search words
- Spelling suggestions
- Remote hosting of search indexes
How did We Provide a Solution?
The plugin was developed to provide WordPress users a better search option, and overcome the limitations of the default search. The Solr Server provides many features by default. We needed to integrate the capabilities using a Solr Client. For the project we made use of Solarium client, because it has several inbuilt functions which facilitates Solr Communication.
For the ability to host solr indexes remotely, we provided an option in the admin settings to either host indexes locally, or remotely on gotosolr.com. Configuration options were provided to select taxonomies and post types to be indexed, facets which had to be included, and search result options.
For websites with large amount of data, you need an efficient search option. Apache Solr is a dedicated search server, which can be used to substantially increase search speed. It makes use of indexes to reduce search time, and supports faceted search, which allows categorization of search results based on taxonomies.
The project involved in depth analysis of the Apache Solr Server, to fully understand it’s capabilities and limitations. The Solr server performs high speed searches using indexes. These indexes can be hosted locally, or remotely. We provided an option to support hosting of indexes remotely on gotosolr.com. To make use of the search functionality, we had to integrate a Solr client. Although there are three possible clients which you can use, we chose Solarium because it provides several functions which made it easier to provide basic search features.
The plugin options allowed users to select a location (local or remote) to host Solr indexes. Users could also select the post types, taxonomies and fields which should be indexed, or post ids which should be excluded.
On the front end, the WordPress plugin performs a broad match search, and the search results are displayed using a search template. By default the search results are sorted by the latest post and pagination is used to display a limited number of results on the search page. The sorting and pagination options can be changed in the admin settings of the plugin. There is also an option to filter search results based on facet options selected.