From a437ca673793e7d21695bc552f700aa5f01e2eb0 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Wed, 5 Jan 2022 13:21:06 +0100 Subject: [PATCH] Update website to use new Algolia search API --- website/meta/site.json | 3 ++- website/src/components/search.js | 3 ++- website/src/pages/404.js | 1 + website/src/templates/index.js | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/website/meta/site.json b/website/meta/site.json index b8f1a58ef..169680f86 100644 --- a/website/meta/site.json +++ b/website/meta/site.json @@ -22,7 +22,8 @@ "list": "89ad33e698" }, "docSearch": { - "apiKey": "371e26ed49d29a27bd36273dfdaf89af", + "appId": "Y1LB128RON", + "apiKey": "bb601a1daab73e2dc66faf2b79564807", "indexName": "spacy" }, "binderUrl": "explosion/spacy-io-binder", diff --git a/website/src/components/search.js b/website/src/components/search.js index eeab9ef40..65d6f235a 100644 --- a/website/src/components/search.js +++ b/website/src/components/search.js @@ -6,13 +6,14 @@ import Icon from './icon' import classes from '../styles/search.module.sass' export default function Search({ id = 'docsearch', placeholder = 'Search docs', settings = {} }) { - const { apiKey, indexName } = settings + const { apiKey, indexName, appId } = settings if (!apiKey && !indexName) return null const [initialized, setInitialized] = useState(false) useEffect(() => { if (!initialized) { setInitialized(true) window.docsearch({ + appId, apiKey, indexName, inputSelector: `#${id}`, diff --git a/website/src/pages/404.js b/website/src/pages/404.js index 4bdd43af6..53baebab9 100644 --- a/website/src/pages/404.js +++ b/website/src/pages/404.js @@ -41,6 +41,7 @@ export const pageQuery = graphql` docSearch { apiKey indexName + appId } } } diff --git a/website/src/templates/index.js b/website/src/templates/index.js index 353ff6067..dfd59e424 100644 --- a/website/src/templates/index.js +++ b/website/src/templates/index.js @@ -235,6 +235,7 @@ export const pageQuery = graphql` docSearch { apiKey indexName + appId } } }