Skip to content

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

POST
/datanotes/operations/search_notes/
curl --request POST \
--url https://example.com/datanotes/operations/search_notes/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "query": "example", "context_length": 100 }'

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).

Media typeapplication/json
object
query
required
string
context_length

Characters of context on each side of a match (at most 1000).

integer
default: 100

Done.

Media typeapplication/json
object
query
required
string
results
required

Matching notes, best first (at most 200).

Array<object>
object
path
required

Vault path of the note.

string
score
required

Matches plus 5 per query word in the path.

number
matches
required

Up to 20 matches.

Array<object>
object
start
required

Where the words start in the text.

integer
end
required
integer
context
required

Text around the match.

string
total
required

Notes that match, all of them.

integer

Example generated

{
"query": "example",
"results": [
{
"path": "example",
"score": 1,
"matches": [
{
"start": 1,
"end": 1,
"context": "example"
}
]
}
],
"total": 1
}

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"
}

Unexpected error.

Media typeapplication/json
object
error
required

What went wrong, for a person or an agent.

string

Example generated

{
"error": "example"
}