infinitered / ir-docs

Omnibus Documentation for Infinite Red Opensource
18 stars 5 forks source link

Set up Algolia search #47

Closed lindboe closed 3 weeks ago

lindboe commented 4 weeks ago

Sets up basic search for IR docs using Algolia.

This should be able to find everything on the site: let me know if there's something you search for that it can't find, or if you get irrelevant search results for your queries.

Screenshot 2024-06-06 at 4 21 39 PM

Testing

Just pull this branch, install deps and run yarn start. It should Just Work (TM).

Future improvements

There are improvements I'd like to make in the future to make this easier to use, primarily revolving around the fact that this site covers documentation for several different tools

  1. Standardize naming and casing ("Ignite-cli" in the top bar should probably just be "Ignite", especially since there's a "CLI" subheading, consistent capitalization on "React-native-mlkit", etc)
  2. Segment results in the search modal by top-level product name (show "Ignite", not "Boilerplate" for results from the boilerplate docs) OR display breadcrumbs for each segment that show the entire header hierarchy. Otherwise it's hard to tell which product results are for.
  3. Get Algolia to prioritize search results for the product docs you are currently viewing. I'm pretty sure this is possible with Algolia's facet filter feature (if what we need isn't already indexed, we can add custom values to facet by: https://docsearch.algolia.com/docs/record-extractor#indexing-content-for-faceting).