Online stores
Typos, facets that keep counting, price sliders and sorts, for catalogs from a hundred products to a million.
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.
synonymEach heading is its own record, so a search opens the section that covers it, not the top of a long page.
remove recordsSynonyms map readers' words onto your product's, such as remove for delete, and a typo still finds the right page.
⌘KThe React SDK's SearchDialog opens with ⌘K or /, with keyboard navigation and highlighted excerpts.
One record per section, built from your Markdown or HTML when the site builds. The recipe in the docs goes through every field.
{ "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}
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.replaceAll on each deploy, so removed sections leave search.Choose the settings once, from your server or the dashboard. Searches then run straight from the browser with the index's public ID.
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,})
import { SearchDialog } from "@findlane/browser/react"export const DocsSearch = () => ( <SearchDialog publicId="pub_8f3kq2…" placeholder="Search the docs" fields={["page", "section", "url", "summary"]} hrefTemplate="{url}" />)
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.
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.
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.
Typos, facets that keep counting, price sliders and sorts, for catalogs from a hundred products to a million.
Search titles, authors and abstracts, narrow by category and year, and sort by citations instead of price.
Give records a location and search nearest first, within a radius, or inside the map's view.
Upload your records, copy a public ID, and put search on your site today.