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

Add appId to Algolia plugin #1733

Merged
merged 2 commits into from
Jan 22, 2022
Merged

Conversation

jonahtanjz
Copy link
Contributor

What is the purpose of this pull request?

  • Documentation update
  • Bug fix
  • Feature addition or enhancement
  • Code maintenance
  • Others, please explain:

Addresses #1729
Overview of changes:
Algolia now requires appId to be provided in order to use its APIs. Add appId to Algolia plugin's options.

Anything you'd like to highlight / discuss:
NIL

Testing instructions:
Add the following to site.json, add algolia attribute to searchbar and serve the site.

"plugins": [
    "algolia"
  ],
  "pluginsContext": {
    "algolia": {
      "apiKey": "599cec31baffa4868cae4e79f180729b",
      "appId": "R2IYF7ETH7",
      "indexName": "docsearch"
    }
  }

Proposed commit message: (wrap lines at 72 characters)
Add appId to Algolia plugin's options


Checklist: ☑️

  • Updated the documentation for feature additions and enhancements
  • Added tests for bug fixes or features
  • Linked all related issues
  • No unrelated changes

Copy link
Contributor

@ang-zeyu ang-zeyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@ang-zeyu ang-zeyu added this to the 3.1.1 milestone Jan 22, 2022
@ang-zeyu ang-zeyu merged commit a75cf43 into MarkBind:master Jan 22, 2022
@damithc
Copy link
Contributor

damithc commented Jan 23, 2022

@jonahtanjz thanks for tackling this. But it looks like adding appId is not enough to get the module website working for this semester; I should be able to pass in the facetFilters parameter as well. If not, search results will contain results from all of my module websites, not just the target module. This is because Algolia has unified all my search indexes to one (we were given separate indexes for each website before).
image

@jonahtanjz
Copy link
Contributor Author

Prof @damithc, try putting the facetFilters in algoliaOptions instead of searchParameters.

"pluginsContext": {
    "algolia": {
      "apiKey": "a3fef7e2d9dea07c0fa2d8ed521057aa",
      "appId": "3DU4XTBX4T",
      "indexName": "nus-tic-cs",
      "algoliaOptions": {
        "facetFilters": ["site:nus-tic2002-2022.github.io"]
      }
    }
  }

@damithc
Copy link
Contributor

damithc commented Jan 23, 2022

Prof @damithc, try putting the facetFilters in algoliaOptions instead of searchParameters.

Ah, that seems to work. Thanks @jonahtanjz

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

Successfully merging this pull request may close these issues.

None yet

3 participants