Skip to content

Latest commit

 

History

History
64 lines (47 loc) · 1.68 KB

renew-algolia-docsearch-index.mdx

File metadata and controls

64 lines (47 loc) · 1.68 KB
id title hide_title sidebar_position tags last_update unlisted
renew-algolia-docsearch-index
Renew Algolia DocSearch Index
true
10
dev-guide
date author
6/24/2024
Tarek Liu
true
  1. Make sure right API_KEY is set in {site_root_dir}/.env file.

    APPLICATION_ID={ALGOLIA_APPLICATION_ID}
    API_KEY={ALGOLIA_API_KEY}

    If your don't have {ALGOLIA_APPLICATION_ID} and {ALGOLIA_API_KEY}, Check APPLICATION_ID and API_KEY in Algolia dashboard.

  2. Build the website.

    $ npm run build
  3. Check render effect through ./build.

    $ npm run serve -- --host 0.0.0.0 --port 3006 --no-open

    Noted that you can't launch the website with npm start this time, because we need to serve the website locally from ./build that we just built.

  4. Proxy your website with ngrok in temporary domain URL.

    The terminal you have your ngrok installed, mine in my local machine:

    $ ngrok http 3006 --region jp
  5. Modify your algolia config in ./algolia/dev-algolia-config.json file.

    {
        "start_urls": ["https://{NGROK_TEMPORARY_DOMAIN_URL}"],
        "sitemap_urls": [
        "https://{NGROK_TEMPORARY_DOMAIN_URL}/sitemap.xml"
        ],
        ...
    }
  6. Run the scraper in WSL2 terminal.

    docker run -it --env-file=.env -e "CONFIG=$(cat ./algolia/dev-algolia-config.json | jq -r tostring)" algolia/docsearch-scraper
  7. Go checkout the Algolia dashboard with specified index_name(e.g. dev_personal_website).

  8. Back to docker terminal and run npm start again, to check the render effect.