Plain-text search: every word of `query` must occur, case- and accent-insensitive, in the
const url = 'https://example.com/datanotes/operations/search_notes/';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"query":"example","context_length":100}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”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.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Characters of context on each side of a match (at most 1000).
Responses
Section titled “Responses”Done.
object
Matching notes, best first (at most 200).
object
Vault path of the note.
Matches plus 5 per query word in the path.
Up to 20 matches.
object
Where the words start in the text.
Text around the match.
Notes that match, all of them.
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.
object
What went wrong, for a person or an agent.
Example generated
{ "error": "example"}Missing or wrong bearer token.
object
What went wrong, for a person or an agent.
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.
object
What went wrong, for a person or an agent.
Example generated
{ "error": "example"}Unexpected error.
object
What went wrong, for a person or an agent.
Example generated
{ "error": "example"}