Use cases

Search for docs and help centers

Readers search for a task or a term, and want the part of the page that answers it. Give each section its own record, and a search opens at the right heading with the matching words highlighted. Our own docs work this way.

What readers search for.

synonym

A term, straight to its section

Each heading is its own record, so a search opens the section that covers it, not the top of a long page.

remove records

Their words, not yours

Synonyms map readers' words onto your product's, such as remove for delete, and a typo still finds the right page.

⌘K

A dialog in one component

The React SDK's SearchDialog opens with ⌘K or /, with keyboard navigation and highlighted excerpts.

What to upload.

One record per section, built from your Markdown or HTML when the site builds. The recipe in the docs goes through every field.

record.json
{  "objectID": "settings#synonyms",  "page": "Search settings",  "section": "Synonyms",  "group": "Guides",  "url": "/docs/settings#synonyms",  "text": "synonyms are groups of words or phrases…",  "code": "",  "summary": "synonyms are groups of words or phrases…",  "level": 3,  "order": 29}
  • The url ends with the heading's anchor, so a result opens at its section.
  • text is plain text, and code has its own field, searched with less weight.
  • level and order keep introductions and main sections ahead of subsections.
  • Upload with replaceAll on each deploy, so removed sections leave search.

Settings and search.

Choose the settings once, from your server or the dashboard. Searches then run straight from the browser with the index's public ID.

server · settings.ts
await docs.replaceSettings({  ...(await docs.getSettings()),  searchableAttributes: [    { field: "section", weight: 8 },    { field: "page", weight: 4 },    { field: "text", weight: 2 },    { field: "code", weight: 1 },  ],  facetFields: [],  filterFields: ["group"],  customRanking: [    { field: "level", direction: "asc" },    { field: "order", direction: "asc" },  ],  synonyms: [["delete", "remove"]],  didYouMean: true,})
react · DocsSearch.tsx
import { SearchDialog } from "@findlane/browser/react"export const DocsSearch = () => (  <SearchDialog    publicId="pub_8f3kq2…"    placeholder="Search the docs"    fields={["page", "section", "url", "summary"]}    hrefTemplate="{url}"  />)

Good to know.

  • Every word in a search must match. Common words like “the” are left out, but question words aren't, so “delete record” works better than “how do I delete a record”.
  • A section's text must fit in 16 KB. Split longer sections.
  • Browser search is public. Docs for signed-in customers go in their own index, searched from your server.

Questions, answered.

Does it work with my docs generator?

Yes. Anything that outputs Markdown or HTML works: build a record per heading when the site builds, and upload them. Ours are built from each page's Markdown on every deploy.

How does search keep up with the docs?

Replace the index's records on every deploy. Searches use the old records until the new ones are all in, so search never shows a half-updated site.

Can I search docs and products together?

Keep them in separate indexes, since they need different settings, and send a search to each. A store's search page can show a few help articles under its products.

Other kinds of data.

Online stores

Typos, facets that keep counting, price sliders and sorts, for catalogs from a hundred products to a million.

Articles and research

Search titles, authors and abstracts, narrow by category and year, and sort by citations instead of price.

Start free with 10,000 records.

Upload your records, copy a public ID, and put search on your site today.