Skip to content

Search the notes by their words and, when semantic search is on, by their meaning:

POST
/datanotes/operations/search/
curl --request POST \
--url https://example.com/datanotes/operations/search/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "query": "example", "limit": 10, "tables": null, "folder": null, "min_score": null }'

Search the notes by their words and, when semantic search is on, by their meaning: {query, results: [{path, table?, score, heading, snippet, matched_by}], meaning}, one result per note, best first. It always works: with semantic search off it ranks by words alone (BM25: rare words count more; a word in the note’s name or properties counts more), with it on it fuses both rankings (Reciprocal Rank Fusion), so a note found only by its words or only by its meaning is still there. matched_by says which (words, meaning); meaning is on, off or failed (the embedding provider failed: words only, meaning_error says why). Query syntax as search_docs: "a phrase" and +word must appear, -word must not (both rankings); words in any language, case and accents ignored, no stemming. Filters: tables (qualified or short names), folder, min_score (the meaning ranking’s cosine floor). limit: default 10, max 100. Then read_note / select_rows for the details.

X-Datanotes-View-As
string

Owner only, on reads only (an operation that only reads, tokens/me/, extensions/, the change stream): the request runs with this named token’s permissions and read scope, and the token’s last_seen does not change. A named token sending it gets 403; a request that is not a read gets 400.

Media typeapplication/json
object
query
required
string
limit
integer
default: 10
tables
Any of:
Array<string>
folder
Any of:
string
min_score
Any of:
number

Done.

Media typeapplication/json
object
query
required
string
results
required

One result per note, best first.

Array<object>
object
path
required
string
table

Qualified table of a row note.

string
score
required

BM25 when ranked by words alone; the Reciprocal Rank Fusion score when fused.

number
heading
required

Heading above the match (empty before the first heading).

string
snippet
required

About 200 characters around the first match, or the best passage by meaning.

string
matched_by
required

The rankings the note is in.

Array<string>
Allowed values: words meaning
meaning
required

On: words and meaning fused; off: semantic search is off, words only; failed: the embedding provider failed, words only.

string
Allowed values: on off failed
meaning_error

Why the meaning ranking failed (with meaning: failed).

string

Example

{
"results": [
{
"matched_by": [
"words"
]
}
],
"meaning": "on"
}

Bad input: the body is not a JSON object, or an argument is unknown, missing or of the wrong type.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

Missing or wrong bearer token.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

A named token whose read patterns do not cover the table, view or note the request names (such as token cook may not read personal.health.weight). Sets it did not name (listings, bases, search, the graph, the change feed) are filtered instead.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}

Unexpected error.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}