Algolia Search
NexT provides Algolia search plugin to search your Hexo website content. It should be noted that only turn on enable
of algolia_search
in NexT config file does not allow you to use the Algolia search correctly. You need to install the corresponding Hexo plugin to index your website on Algolia: Hexo Algolia or Hexo Algoliasearch.
Known Issues
- The latest version of the Hexo Algolia plugin removes the content indexing feature, given Algolia’s free account limitation.
- The Hexo Algoliasearch plugin provides content indexing functionality. The same problem exists with
Record Too Big
for Algolia’s free account.
Follow the steps described below to complete the installation of Algolia search.
Register at Algolia, you can log in directly using GitHub or Google Account. Upon Customer’s initial sign-up for an Account, Customer will have a free, fourteen (14) day evaluation period (the «Evaluation Period») for the Algolia Services commencing on the Effective Date, subject to the limitations on Algolia’s website. After that, Algolia offers a free, branded version for up to 10k records and 100k operations per month.
If a tutorial pops up, you can skip it. Go straight to create an Index
which will be used later.
Go to the
API Keys
page and find your credentials. You will need theApplication ID
and theSearch-only API key
in the following sections. TheAdmin API key
need to keep confidential. Never store your Admin API Key asapiKey
in Hexo config file: it would give full control of your Algolia index to others and you don’t want to face the consequences.In the
API Keys
page, click theAll API Keys
button to switch to the corresponding tab. Then click theNew API Key
button to activate a pop-up box where you can setup authorizations and restrictions with a great level of precision. EnteraddObject
,deleteObject
,listIndexes
,deleteIndex
features in ACL permissions that will be allowed for the given API key. And then click theCreate
button. Copy this newly created key to the clipboard, we call it aHigh-privilege API key
.
Algolia requires users to upload their search index data either manually or via provided APIs. You need to choose one of the following two plugins to install. Both plugins will index your site and upload selected data to Algolia.
Install and configure Hexo Algolia in your Hexo directory.
$ cd hexo-site |
In your Hexo config file, add the following configuration and replace the Application ID
, Search-only API key
and indexName
with corresponding fields obtained at Algolia.
algolia: |
Run the following command to upload index data, keep a weather eye out the output of the command.
$ export HEXO_ALGOLIA_INDEXING_KEY=High-privilege API key # Use Git Bash |
Install and configure Hexo Algoliasearch in your Hexo directory.
$ cd hexo-site |
In your Hexo config file, add the following configuration and replace the Application ID
, Search-only API key
, High-privilege API key
and indexName
with corresponding fields obtained at Algolia.
algolia: |
Run the following command to upload index data, keep a weather eye out the output of the command.
$ hexo clean |
In NexT config file, turn on enable
of algolia_search
. At the same time, you need to turn off other search plugins like Local Search. You can also adjust the text in labels
according to your needs.
# Algolia Search |
Local Search
Local search does not require any external 3rd-party services and can be extra indexed by search engines. This search method is recommended for most users.
Install hexo-generator-searchdb
by executing the following command in site root dir:
$ npm install hexo-generator-searchdb |
Edit Hexo config file and add following content:
search: |
Edit NexT config file to enable Local Search:
# Local search |