Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AlgoliaSearchError: Invalid Application-ID or API key #454

Closed
rafaelnsantos opened this issue Feb 16, 2018 · 11 comments
Closed

AlgoliaSearchError: Invalid Application-ID or API key #454

rafaelnsantos opened this issue Feb 16, 2018 · 11 comments

Comments

@rafaelnsantos
Copy link

rafaelnsantos commented Feb 16, 2018

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Github gh-pages
docusaurus: 1.0.6

Steps to Reproduce

  1. Open https://rafaelnsantos.github.io/unity-cloudsave/
  2. Type in search box

Expected Behavior

Show result box.

Actual Behavior

Result box don't show.

This is the Request URL:
https://bh4d9od16a-3.algolianet.com/1/indexes/*/queries?x-algolia-agent=Algolia%20for%20vanilla%20JavaScript%203.21.0%3Bdocsearch.js%201.5.0&x-algolia-application-id=BH4D9OD16A&x-algolia-api-key=db51bcd5e513cfe52faa7ea59f2566b5

This is not my algolia-application-id, couldn't find where to set it.

Reproducible Demo

https://rafaelnsantos.github.io/unity-cloudsave/

  1. Open
  2. Type in search box
@JoelMarcey
Copy link
Contributor

@rafaelnsantos Hi! Did you set your algolia config, including your id, in siteConfig.js?

As described here: https://docusaurus.io/docs/en/search.html#enabling-the-search-bar

Here is how we did it for Docusaurus - https://github.com/facebook/Docusaurus/blob/master/website/siteConfig.js#L134

@rafaelnsantos
Copy link
Author

This is the siteConfig https://github.com/rafaelnsantos/unity-cloudsave-site/blob/master/website/siteConfig.js#L68

I couldn't find how to set the id.

@JoelMarcey
Copy link
Contributor

Hi @rafaelnsantos -- your setting looks correct. Maybe I am misunderstanding the issue here.

Did you get that apiKey directly from Algolia? i.e., did they email it to you?

I see you have an Algolia config here for your site: https://github.com/algolia/docsearch-configs/blob/master/configs/unity_cloud_save.json

@rafaelnsantos
Copy link
Author

Hi @JoelMarcey I'm using the apiKey from algolia dashboard, the email didn't have an apiKey.

The issue is the application-id in the request, I believe BH4D9OD16A is facebook's algolia application id.

Where can I change algolia application id?

@JoelMarcey
Copy link
Contributor

We don't use the application-id in Docusaurus. e.g., no where in https://github.com/facebook/Docusaurus do we use application-id.

I checked a couple of other sites that use Docusaurus - https://docusaurus.io/en/users.html

They don't use application-id either.

Is this something you may want to ask support@algolia.com about?

@rafaelnsantos
Copy link
Author

Thank you @JoelMarcey ! Solved talking to algolia support.

@JoelMarcey
Copy link
Contributor

Great! I am glad you were able to resolve this.

@stonebk
Copy link

stonebk commented Aug 1, 2018

@rafaelnsantos what was your solution?

@s-pace
Copy link

s-pace commented Aug 3, 2018

👋 Are you running DocSearch yourself or are you using the hosted version of it?

When we host it for you, you do not need to mention your appId but once you are using it on your own, you need to specify it.

@dsmmcken
Copy link
Contributor

Comment for future searchers. If you are running your own agolia crawler you MUST set your own app ID from your agolia account.

appId: 'BH4D9OD16A', is tied to the docsearch free account appId, and is hardcoded as the default.

Set your appId in the docusaurus.config.js as

themeConfig: {
    agolia: {
        appId: 'your-app-id',
        apiKey: 'your-api-key',
    }
}

Might be worth a note on the https://v2.docusaurus.io/docs/search/#connecting-algolia section that appId must be set if you are running your own crawler.

@slorber
Copy link
Collaborator

slorber commented Nov 13, 2020

@dsmmcken docs PR are welcome :)
Afaik this id is global for all DocSearch: https://docsearch.algolia.com/docs/behavior/#appid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants