Skip to content

use docsite built-in search

Administrator requested to merge docsite-search into master

Created by: sqs

This uses docsite built-in search instead of a Google search with site:docs.sourcegraph.com. The benefits of this are:

  • new results are available immediately instead of waiting for Google to reindex
  • search results show the matching sections within the document, not just the document title, which means we don't need to make lots of shorter pages just to have Google show good results (this is esp. a problem for the handbook, which also uses docsite's search)
  • the search is built into the UI, so there is no context switching when searching
  • search is more precise and doesn't filter out special characters or code (as Google sometimes does)
  • (in the future) you will be able to search over any version, not just the default version

docsite already supports search, but this commit (1) adds a template and styles to display search results and (2) makes the root template's search form submit to the docsite search handler, not Google.

The docsite search is not super optimized or tuned, but the corpus is small enough that the result relevance is on par with Google in all cases I saw (and perf is about the same too, like ~300ms per search).

Merge request reports

Loading