-
Notifications
You must be signed in to change notification settings - Fork 55
Getting Started
A guide to setting up the WP Search with Algolia (WPSwA) plugin.
When logged into the WordPress Dashboard, find the "Algolia Search" entry in the left-hand admin menu and click on it.
You will be presented with the Settings page where you configure your Algolia credentials:
If you do not have an Algolia account yet, you can create one for free at https://www.algolia.com/users/sign_up.
Once you have created your account and you have signed in, access your Algolia API keys by going to https://www.algolia.com/api-keys.
From that screen you will need to copy/paste the following keys from the Algolia dashboard to your WordPress admin form:
- Application ID
- Search-Only API Key
- Admin API Key
Copy/pasting these keys manually is very error prone. There is a copy button at the right side of each key that will make this easier.
Once you have filled in the required keys on the Settings page, click on the Save Changes
button at the bottom of the form.
Once you have correctly provided WordPress with your Algolia keys, you will see that the Algolia Search menu entry has expanded:
The Algolia Search -> Search Page settings screen allows you to configure how WPSwA will affect your WordPress search page functionality.
This settings page also offers "Re-index search page records" and "Push Settings" buttons at the top of the page.
The Do not use Algolia
option will allow post content to be indexed, but will not affect native WordPress search functionality.
The Use Algolia in the backend
and Use Algolia with Instantsearch.js
options will replace WordPress native search functionality with an Algolia client powered implementation.
With this option, the native WordPress search experience will not be replaced by Algolia.
Content will be indexed in the searchable_posts
index, but it will not affect the native WordPress search page experience.
This option can be useful when you only need WPSwA to index your WordPress content. For example, if you intend to...
- Make your content searchable from another site that implements Algolia
- Build a custom search UI with your own Algolia client implementations
- Build a headless WordPress site and your own Algolia client implementations
With this option, the native WordPress search page will be powered by the Algolia Search API Client for PHP.
It modifies the WP_Query used on the search results page, to use results from the searchable_posts
index instead of the WP database.
This will allow your search results to be typo tolerant.
This option does not support filtering and displaying instant search results.
This works with themes that use standard, native, WordPress search.
If you have a plugin, theme, or custom code, that also modifies WP_Query searches, you may experience conflicts, pagination issues, or unexpected results.
We are unable to provide support for third party themes, plugins, and custom code.
If you experience issues with this option, try the Use Algolia with Instantsearch.js
option.
With this option, the native WordPress search page will be powered by the lightning fast Algolia instantsearch.js.
It replaces your standard search results page with an instant search experience.
Instantsearch.js will use the searchable_posts
index.
If you experience issues with this option, try the Use Algolia in the backend
option.
Please note that the plugin is shipped with some sensible default styling rules but it could require some CSS adjustments to provide an optimal search experience.
WPSwA always creates a searchable_posts
index.
Both the Use Algolia in the backend
and Use Algolia with Instantsearch.js
options use the searchable_posts
index for the Search Page feature.
There is currently no user interface to configure what will be indexed in the searchable_posts
index, but there are filters in the code so that searchable_posts
indexing can be customized.
The Algolia Search -> Autocomplete settings screen allows you to configure WPSwA to display drop down results in WordPress search forms that appear outside of the search page, such as the default WordPress Search widget (i.e. form inputs identified by name='s'
)*.
* For WPSwA 2.3.x and earlier
To enable the Autocomplete feature, check the Enable autocomplete
box above the configuration table.
Here you may configure one or more indices that Autocomplete will use for displaying it's drop down results.
For many users, this may simply be the "All posts" (searchable_posts
) index that is also used by the Search Page feature.
However, some users may wish to display results in the Autocomplete drop down by individual post type, or also display results by taxonomy term, or even by user.
Please note: If you have installed other plugins, or have custom code that creates additional post types and taxonomies, you may have more entries than in the above screenshot.
The WP Search with Algolia plugin uses WordPress core features such as Post Types, Taxonomies and Users to find potential content types for indexing. Any plugin creating new Post Types or Taxonomies will also be listed here as eligible for synchronization with Algolia.
The order of the content types are draggable and able to be re-arranged. The order that the checked items are listed is the order in which they show in the Autocomplete dropdown results.
Setting name | Description |
---|---|
Enable | Make search results for this index available to autocomplete. |
Index | The type of data and the name of the index in the Algolia dashboard. |
Max Suggestions | The maximum number of suggestions to display for this index. Only the n most relevant search results will be displayed. Others will not be shown. |
Please note: Configuration of indices on the Autocomplete settings page does not configure the index used by the Search Page with the Use Algolia in the backend
, or the Use Algolia with Instantsearch.js
options. The Search Page uses the searchable_posts
index. Autocomplete can be configured to use the searchable_posts
index as well, but it can also be configured to use independent indices for a given content type.
Be aware that each enabled checkbox, other than "All posts", on this settings screen will create additional indices in Algolia, which will increase your indexing usage, and these additional indices are only used by the Autocomplete feature, not the Search Page feature.
Check the checkboxes next to the indices you wish to use with Autocomplete and click on Save Changes
button.
Green validation messages should confirm that the selected indices are about to be synchronized with Algolia.
Click on the Index now
button to send your content to Algolia. After that, everything will be kept in sync automatically.
If you would like to learn more about Algolia and how you can benefit from it, go to Algolia's getting started page at https://www.algolia.com/doc/guides/getting-started/what-is-algolia/
Struggling with something? Check out the FAQ section.