# Plain-text search: every word of `query` must occur, case- and accent-insensitive, in the

`POST /datanotes/operations/search_notes/` (operation `search_notes`)

Plain-text search: every word of `query` must occur, case- and accent-insensitive, in the
note's path or text; there are no operators. Returns `{query, results: [{path, score, matches:
[{start, end, context}]}], total}`, best first: at most 200 notes (`total` counts them all) and 20
matches per note. `context_length`: characters of context on each side (default 100, max 1000).

## Request body

`application/json`, required

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `query` | `string` | yes |  |  |
| `context_length` | `integer` | no | `100` | Characters of context on each side of a match (at most 1000). |

## Responses

| Status | Description | Body |
| --- | --- | --- |
| 200 | Done. | `object` (application/json) |
| 400 | Bad input: the body is not a JSON object, or an argument is unknown, missing or of the wrong type. | `Error` (application/json) |
| 401 | Missing or wrong bearer token. | `Error` (application/json) |
| 500 | Unexpected error. | `Error` (application/json) |

The schemas named here are in [openapi.json](https://datanotes.dev/openapi.json) (`components.schemas`).
