Filter and refine search
Narrow a document search with source, provider, and date filters, and read the ranked results.
/documents/search runs full-text search across your documents' titles and
content and returns the best matches, each with a relevance score and the source
document it came from. This guide shows how to narrow those results with filters
and how to read the response.
The request
Only query is required. Everything else narrows or bounds the results.
curl https://nordvec.com/api/v1/documents/search \
-H "Authorization: Bearer $NORDVEC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "renewal terms",
"limit": 20,
"datasource": "contracts",
"sourceProvider": "google_drive",
"createdAfter": "2026-01-01T00:00:00Z",
"createdBefore": "2026-07-01T00:00:00Z"
}'| Field | Type | Notes |
|---|---|---|
query | string | Required. 1 to 500 characters. |
limit | integer | Optional. 1 to 50. How many results to return (default applies when omitted). |
datasource | string | Optional. Restrict to one datasource (up to 100 characters). |
sourceProvider | string | Optional. Restrict to one connector provider, e.g. the source a document synced from. |
createdAfter | string | Optional. ISO 8601 timestamp; only documents created at or after it. |
createdBefore | string | Optional. ISO 8601 timestamp; only documents created before it. |
Every filter is combined with AND: a document must match the query and every filter you supply. Leave a filter out to widen the search.
The response
{
"results": [
{
"id": "…",
"title": "Acme Corp Master Services Agreement",
"snippet": "…renews automatically for successive twelve month terms…",
"score": 0.82,
"datasource": "contracts",
"source_provider": "google_drive",
"source_type": "…",
"mime_type": "application/pdf",
"status": "indexed",
"created_at": "2026-02-14T09:00:00Z",
"updated_at": "2026-02-14T09:00:00Z"
}
],
"totalCount": 7
}Each result carries a snippet with the matching text, a score from 0 to 1
(higher is more relevant), and the source document's metadata so you can trace it
back. totalCount is how many documents matched in total, which may be larger
than the number of results you asked for with limit.
Reading the results
- Results are ranked by relevance, most relevant first. Use
scoreto decide a cut-off if you only want strong matches. totalCountvsresults.length:resultsholds up tolimititems;totalCountis the full match count. IftotalCountis much larger than yourlimit, tighten thequeryor add a filter rather than expecting every match back in one call.- Only indexed documents are searchable. A document with
statusofprocessingorfailedis not yet retrievable; see Documents & search for the lifecycle.
Search only ever returns documents the caller is allowed to see. Access is enforced at the data layer, not in application code, so a filter can never widen your visibility beyond your own documents.