Page MenuHomePhabricator

Consider adding search to the Codex docs site
Open, LowPublic3 Estimated Story PointsSpike

Description

As a user of Codex, I want to be able to quickly find the page I want to go to

As a user of Codex, I want the option of searching for something instead of reading through the navigation menus

Search is critical for a documentation website, and we've already identified issues with not having it (see discussion on the component groups task). Search will be an important complement to navigation menus.

VitePress has two built-in options for search:

Additionally, we should evaluate the default UI for search that VitePress offers, and consider which updates are worth making to improve it and make it follow our design system.

Acceptance criteria

  • Determine which search engine to use
  • Launch a basic implementation
  • Document improvements to search results/search engine configuration
  • Document improvements to search UI

Future tasks

Event Timeline

@egardner suggested we consider using Lunr, which is FOSS. Here's an example: https://www.getty.edu/publications/romanmosaics/

If Algolia integration is free and straightforward, then that's probably a good solution. But in the past I've had good luck with Lunr for client-side search in these kinds of sites. Since the content is all static, we can generate a search index at build time (most likely a big JSON file) and then feed it into Lunr when the user triggers the search. You can even weight different fields (setting matches in titles to be worth more than matches in body text, etc) to tune the results.

Would be cool if we could actually use Typeahead with a different back-end for this purpose.

This code is in Ruby and specific to the Middleman site generator, but it would be pretty simple to do something similar in Node that loops through all the pages in the docs site and builds a data structure, then writes it to a file on disk in JSON format.

ldelench_wmf moved this task from Inbox to Needs Refinement on the Design-System-Team board.
egardner changed the subtype of this task from "Task" to "Spike".Sep 28 2022, 8:24 PM
egardner updated the task description. (Show Details)
ldelench_wmf lowered the priority of this task from High to Low.Oct 24 2022, 4:13 PM

I'm playing around with the new local search feature

Change #1105038 had a related patch set uploaded (by Anne Tomasevich; author: Anne Tomasevich):

[design/codex@main] [proof of concept] Enable local search

https://gerrit.wikimedia.org/r/1105038

Change #1105038 merged by jenkins-bot:

[design/codex@main] docs: Enable local search

https://gerrit.wikimedia.org/r/1105038

@AnneT What's meant by the last AC "Document improvements to search UI"?

@Volker_E in the design sync, we agreed that @bmartinezcalvo would open a task to document future improvements to the VitePress search UI

El T317792#10417333, @AnneT escribió:

@Volker_E in the design sync, we agreed that @bmartinezcalvo would open a task to document future improvements to the VitePress search UI

This is the task for the design improvements T382574: Codex search: review styles. Thank you!

  NODES
HOME 1
Note 1
OOP 1
os 7
text 1
visual 2
web 1