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

DOCS: Integrate Algolia Search into Docs #114

Open
19 tasks
HamzaAmar opened this issue Jan 1, 2025 · 0 comments
Open
19 tasks

DOCS: Integrate Algolia Search into Docs #114

HamzaAmar opened this issue Jan 1, 2025 · 0 comments

Comments

@HamzaAmar
Copy link
Owner

HamzaAmar commented Jan 1, 2025

Goals:

Enable users to quickly find relevant components, documentation, and other resources within the Documentation.

Provide a seamless and intuitive search experience.

Utilize Algolia's robust search capabilities.

Implementation Steps:

1. Set up Algolia Account and Application:

  • Create an Algolia account.
  • Create a new application within Algolia for the design system.
  • Obtain Application ID, Search-Only API Key, and Admin API Key. Securely store these keys (environment variables are recommended).

2. Install necessary dependencies:

  • Install the Algolia JavaScript API client: npm install algoliasearch-client-javascript
  • Install instantsearch.js for the UI components: npm install instantsearch.js
  • Potentially install other relevant UI libraries like React InstantSearch if you prefer pre-built components: npm install react-instantsearch-dom

3. Prepare and Index Data:

  • Identify searchable content: Determine which content within the design system should be indexed (e.g., component names, excerpt, documentation pages).
  • Data fetching: Implement logic to fetch this data from your existing data sources Markdown files.
  • Data transformation: Transform the fetched data into a format suitable for Algolia indexing (JSON records with clear attributes like objectID, name, description, url, etc. Consider hierarchy to prioritize top-level categories/components.)
  • Indexing script: Create a script (e.g., using the Algolia API client) to upload the transformed data to your Algolia index. This script might need to be run periodically to keep the index up-to-date.

4. Implement Search UI:

  • Create a search input component.
  • Use instantsearch.js or react-instantsearch-dom to build the search results display and other UI elements (facets, filters, pagination, etc.).
  • Configure the search client with your Application ID and Search-Only API Key.
  • Connect the search UI to your Algolia index.
  • Style the search UI to match the design system's aesthetics.

5. Testing and Refinement:

  • Thoroughly test the search functionality to ensure it returns accurate and relevant results.
  • Experiment with different Algolia settings (e.g., ranking rules, synonyms, typo tolerance) to optimize search performance
    and relevance. Algolia's dashboard provides analytics to help with this.
  • Gather user feedback and iterate on the search experience.

6. Deployment:

  • Deploy the updated design system site with the integrated Algolia search.
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

1 participant