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

  1. Apply for an Algolia account, get APP_ID and API_KEY (data write access is required).

  2. 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
    
  3. everkm.yaml add configuration entry cfg.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

  1. indexLanguages, queryLanguages

    Add your primary language as the first one, followed by English. If the primary language is English, you can leave it unset.

  2. searchableAttributes

    Search Fields title, content

  3. separatorsToIndex

    Set to -_ to make it a searchable keyword.

  4. attributeForDistinct

    The name of the attribute used to record the de-duplication.