Filter and refine search
Narrow a document search with datasource, provider, type and date filters, and read the ranked results.
/documents/search runs full-text search over the title and the whole text of
your documents and returns the best matches, each with a relevance score and the
source document it came from. This guide shows how the query matches, how to
narrow the results with filters, and how to read the response.
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",
"createdAfter": "2026-01-01T00:00:00Z",
"createdBefore": "2026-07-01T00:00:00Z"
}'| Field | Type | Notes |
|---|---|---|
query | string | Required. 1 to 500 characters. Quoted phrases, or and a leading - to exclude a word are understood. |
limit | integer | Optional. 1 to 50, default 20. How many results to return. |
datasource | string | Optional. Restrict to one datasource by its slug (up to 200 characters). |
sourceProvider | string | Optional. Restrict to one connector provider, for example google, sharepoint or slack. |
createdAfter | string | Optional. ISO 8601 timestamp with an offset; only documents created at or after it. |
createdBefore | string | Optional. ISO 8601 timestamp with an offset; only documents created at or before it. |
contentType | string | Optional. Restrict to one knowledge type, the type a pushed document or a knowledge file declares (for example policy or runbook). |
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 whole document is searched. The title and every passage of the text count, however long the document is.
- Words match in the form you write them, in any language. There is no
stemming:
invoicedoes not matchinvoices, andtilbagebetalingdoes not matchtilbagebetalingen. To catch several forms, join them withor. - Accents are ignored on both sides.
cafefindscafé, andbørnehaveandbornehavefind each other. Case is ignored too. - Operators. Put words in double quotes to match them as a phrase, write
orbetween words to match either, and put-before a word to leave out documents that contain it.
Signed in, you can run a search over your own documents from this page. Change the query in the API reference to try your own.
POST /api/v1/documents/search
{
"query": "renewal terms",
"limit": 5
}Runs as you, with the session you are signed in with, and returns only what you can see. This page never handles a key.
{
"results": [
{
"id": "0198f2a4-6c1e-7d30-b6a1-2f9d54c08a11",
"title": "Acme Corp Master Services Agreement",
"snippet": "Automatic **renewal**: the agreement continues for successive twelve month **terms** unless…",
"score": 0.82,
"datasource": "contracts",
"source_provider": "google",
"source_type": null,
"mime_type": "application/pdf",
"content_type": null,
"status": "indexed",
"created_at": "2026-02-14T09:00:00Z",
"updated_at": "2026-02-14T09:00:00Z"
}
],
"totalCount": 7
}Each result is one document. Its snippet is cut from the passage that matched
best, wherever that passage is in the text, with the matched words wrapped in
**; a word you typed without its accents is found and ranked, but may appear
unmarked in the snippet. The score runs from 0 up to, but never reaching, 1
(higher is more relevant), and the source document's metadata lets you trace
the result back. totalCount is how many documents matched in total, which may
be larger than the number of results you asked for with limit.
- Results are ranked by relevance, most relevant first. A document ranks by
its best-matching passage. Use
scoreto drop weak matches within one set of results; scores from different queries are not on the same scale. totalCountvsresults.length:resultsholds up tolimititems;totalCountis the full match count. IftotalCountis much larger than yourlimit, tighten thequeryor add a filter; there is no second page of search results.statustells you where the document is in processing. A document is matched on its stored text, so one stillprocessingcan appear;indexedmeans every step finished. See Documents & search for the lifecycle.
Search only ever returns documents the caller is allowed to see. Access is enforced in the database, not in application code, so a filter can never widen what the caller sees. For an API key that is what the workspace shares; see Who sees a document.
Was this page helpful?
Push documents from your own systems
Create a datasource, push documents into it with an indexing API key, choose who can read them, and pause or delete it when the source changes.
List and retrieve documents
Page through your documents with cursor pagination, filter and sort them, and fetch one or many by id.