Embedded Search
Currently the official template yilog uses the solution provided by Algolia. Everkm provides one-stop data push and front-end interface integration, visit yilog to see the demo.
Quick Start
-
Apply for an Algolia account, get
APP_ID
andAPI_KEY
(data write access is required). -
Install the configuration
# Install pnpm install -D everkm-algolia # Set the API parameter environment variable export ALGOLIA_APP_ID="${{ secrets.ALGOLIA_APP_ID }}" export ALGOLIA_API_KEY="${{ secrets.ALGOLIA_API_KEY }}" # Clear the data and reset the configuration . /node_modules/.bin/ekmp-algolia --index-name <index name> reset --languages zh --languages en # Push pages in the specified directory . /node_modules/.bin/ekmp-algolia --index-name <index name> walk --url-base https://<Your domain>/ --dir dist
-
everkm.yaml
add configuration entrycfg.embed_search
cfg: embed_search: app_id: <app id> api_key: <api search key> index: <index name>
Configuration items modified by everkm-algolia reset
command
-
indexLanguages
,queryLanguages
Add your primary language as the first one, followed by English. If the primary language is English, you can leave it unset.
-
searchableAttributes
Search Fields
title
,content
-
separatorsToIndex
Set to
-_
to make it a searchable keyword. -
attributeForDistinct
The name of the attribute used to record the de-duplication.