Document Search
The workflow for suggestions, query execution, indexing requests, and search-aware document UX.
Document search is designed so users can inspect matching text before opening a file.
Recommended UX Flow
- Call
POST /v1/search/suggestionswhile the user types. - Call
POST /v1/searchwhen the user submits or pauses. - Render
DocumentandDocumentContentresults with the returnedsnippet. - Show
source.pageNumberwhen present. - Track the response
searchId. - Open the full document only when the user explicitly chooses to.
- Report preview and open events with
POST /v1/search/interactions.
Rendering Document Results
For document-heavy views, prefer this layout:
- title: original filename
- subtitle: object key or storage path context
- preview:
snippet - context badge:
Page {source.pageNumber}when available
This gives users enough context to decide whether a document is relevant without downloading or opening it first.
When the user opens the full document, report that interaction against the original searchId. That data is what later lets ranking favor results that are actually opened instead of merely shown.
Rendering DocumentContent Results
Use DocumentContent results when you want to emphasize the exact matching passage:
- keep the parent filename visible
- display the excerpt from
snippet - route to a document preview or viewer anchored to the matching page if your client supports it
Operational Notes
Document previews depend on indexed passage text. If preview text is missing:
- confirm the document is a supported text-extraction format
- trigger
POST /v1/search/index/documents/{documentId} - check
GET /v1/search/index/status
For large legacy datasets, queue a backfill so older documents receive passage previews as well.
If clusters, locations, annotations, or document cards themselves are missing from universal search, run the asset backfill endpoint in addition to the document passage backfill.