mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-10 19:57:17 +03:00
Merge pull request #9989 from explosion/docs/update-algolia-search-api [ci skip]
This commit is contained in:
commit
005e23a525
|
@ -22,7 +22,8 @@
|
|||
"list": "89ad33e698"
|
||||
},
|
||||
"docSearch": {
|
||||
"apiKey": "371e26ed49d29a27bd36273dfdaf89af",
|
||||
"appId": "Y1LB128RON",
|
||||
"apiKey": "bb601a1daab73e2dc66faf2b79564807",
|
||||
"indexName": "spacy"
|
||||
},
|
||||
"binderUrl": "explosion/spacy-io-binder",
|
||||
|
|
|
@ -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}`,
|
||||
|
|
|
@ -41,6 +41,7 @@ export const pageQuery = graphql`
|
|||
docSearch {
|
||||
apiKey
|
||||
indexName
|
||||
appId
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -235,6 +235,7 @@ export const pageQuery = graphql`
|
|||
docSearch {
|
||||
apiKey
|
||||
indexName
|
||||
appId
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user