Skip to main content
CodivDocs

Search

Full-text search across your docs site with a keyboard-first modal.

How it works

Search runs directly against Postgres — there is no external Algolia or Meilisearch instance to manage, and no indexing step after deploy. Every time a page is synced from your GitHub repo, a stored tsvector column is regenerated automatically with weighted content:

WeightFieldDescription
A (highest)frontmatter.titleMatches against the page title rank first
Bfrontmatter.descriptionNear-first hit boost for description matches
CURL pathKeyword-in-URL matches
D (lowest)page bodyFull-text fallback

When a reader submits a query, the platform calls websearch_to_tsquery — the same query parser Postgres uses for Google-style searches. That means your users can write:

"custom domain"          exact phrase
authentication OR oauth  either term
components -accordion    exclude a term

Keyboard shortcuts

Open search

⌘K on macOS, Ctrl+K on Windows/Linux, or / from any page

Navigate

and to move through results

Open result

Enter to navigate to the highlighted result

Close

Esc to dismiss the modal and return to the page

Result ranking

Results are ordered by ts_rank, which scores matches based on frequency, term weight, and proximity. Short snippets with <mark> highlighting appear under each result so readers can confirm relevance before clicking.

If a reader searches for a term and gets zero results, that usually signals a content gap. In Phase 7 you will see these queries in your analytics dashboard — a great input for the next pages to write.

What to write for better search

The weighted ranking rewards well-structured pages. You don't need to do anything special — just follow good documentation habits:

  1. Write a clear title in frontmatter. It carries the highest rank weight.

  2. Add a description of 1–2 sentences explaining the page. Boosts near-first hits.

  3. Use descriptive URL paths. /configuration/custom-domain ranks better than /config/cd.

  4. Lead with the keyword. The first 200 characters matter most for snippet extraction.

Semantic search (coming in Phase 5)

Keyword search is Phase 1. In Phase 5 the same modal will gain a sparkle toggle for AI mode — hybrid keyword + vector search powered by pgvector embeddings and reciprocal rank fusion. Readers will be able to ask natural-language questions and get results that match intent, not just keywords.

No action needed on your side. When Phase 5 ships, your existing docs will be embedded automatically and the AI toggle appears in the modal. Your ⌘K habits transfer 1:1.

Last updated April 12, 2026