# Documents & search
Source: https://nordvec.com/docs/guides/concepts/documents

Documents are the searchable unit in Nordvec. Ingest them, then find them with full-text search over the API.

A **document** is the unit Nordvec searches over: a file, a page, a message, an
email, whatever you ingest. Once a document is processed it becomes searchable
and can be cited in an answer.

## Ingesting documents [#ingesting-documents]

Documents enter your workspace three ways:

- **Connectors** sync from a source you own (the connector owner). New and
  changed documents are picked up automatically. See the
  [connector catalogue](/docs/guides/connectors).
- **Uploads** of files you add in the app.
- **Push** sends a document to Nordvec directly from your own system. See
  [Push documents](/docs/guides/how-to/push-documents).

Whichever way it arrives, Nordvec processes the document, splits it into passages, and indexes
it for retrieval. Your documents are stored and searched in the EU.

A document has a `status`: `processing` while it is being indexed, `indexed`
once every processing step has finished, and `failed` when it could not be processed.

## Who sees a document [#who-sees-a-document]

A document from a connector is private to the person who connected it until
that person shares it. An API key belongs to the workspace, so it sees what the
workspace shares and never a person's unshared documents.

## Searching [#searching]

`/documents/search` is **full-text** search over the title and the whole text
of every document you can see, however long the document is. Words match in the
form you write them, in any language, and accents are ignored on both sides, so
`cafe` finds `café`. There is no stemming: `invoice` does not match `invoices`.

Search runs standalone, without conversation context. It returns ranked
documents, each with a snippet from its best-matching passage and a relevance
score from 0 up to, but never reaching, 1.

```bash
curl https://nordvec.com/api/v1/documents/search \
  -H "Authorization: Bearer $NORDVEC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "query": "renewal terms", "limit": 10 }'
```

You can also list documents (`/documents/list`) or fetch one by id
(`/documents/{id}`). See the [API reference](/docs/api) for the full set of
parameters and response shapes.

### Try it [#try-it]

Run a query against a small demo corpus. This searches six sample documents in
your browser, ranked and sourced, the same shape a real search returns.

<LiveSearchDemo />

Semantic retrieval, which matches passages by meaning rather than exact words,
is what powers a [conversation's](/docs/guides/concepts/conversations) cited
answers. The search endpoint itself matches words.

<Callout>
Search only ever returns documents the caller is allowed to see. Access is
enforced in the database, not in application code.
</Callout>

## Content types [#content-types]

A document can carry a knowledge type in `content_type` (for example
`decision`, `runbook`, `policy` or `faq`). A pushed document sets it with the
push API's `type`; a document with no type has `content_type: null`. Search and
list both filter on it with `contentType`.

## Where documents are cited [#where-documents-are-cited]

Search gives you passages to work with directly. When you want a written answer
instead of raw passages, a [conversation](/docs/guides/concepts/conversations)
retrieves over the same documents and cites them in its reply.
