search_documents MCP tool. The parser produces
a typed query plan; user text is never interpolated into SQL or passed through
as raw FTS5 syntax.
For indexing, BM25, recency, autocomplete, similar-document search, and Archive
research retrieval, see Search architecture.
All clauses, symbolic names, ambiguity suggestions and saved/snapshot View scopes
resolve inside the selected or token-bound filing system. jd:13 is a local
category filter, not a cross-system lookup. Full addresses entered in Search or
Omnibox use the separate address resolver, not a new query qualifier.
The query can narrow visible documents, never grant system entry or document ACLs.
Quick examples
Terms, prefixes, and phrases
A bare word is a Unicode-aware prefix term:annu and rep, such as “annual
report”. Do not type *; raw FTS wildcard syntax is rejected.
Double quotes create an exact phrase rather than a prefix:
title: or content: to constrain a text term or phrase to one indexed
column:
title: and content: values are prefixes. Quoted values are phrases.
Implicit AND
Whitespace between positive clauses means AND:invoice… term and a renewal… term.” Filters compose
the same way:
AND; explicit Boolean operators
are unsupported.
Negation
Prefix a term, phrase, or filter with- to exclude it:
Filters
See Document dates for extraction, confidence, review, and
Calendar behavior.
Examples:
added: and date: accept comparison operators. tag:>=tax is rejected.
All positive date: comparisons and date-role: clauses must match the same
Calendar date. Negated date clauses remain independent NOT EXISTS
conditions. Dates available to Calendar are readable document metadata, so
these predicates require documents:read, not archive_intelligence.
Metadata names are resolved before execution. Unknown values return errors;
ambiguous values return suggestions.
Escaping
Backslash escapes the next character in bare or quoted text. Use it when a literal colon would otherwise start a filter:- means negation. Escape it when it is literal text:
:, comparisons, quotes, parentheses, *, ^, {, and } must
be quoted or escaped when intended as literal text. Non-whitespace control
characters are always rejected.
Unsupported syntax
Suchi does not implement a general Boolean or raw FTS language:OR, AND, NOT, and NEAR; grouping and precedence; proximity;
raw FTS5 wildcards, boosts, and columns; and SQL-like expressions are rejected.
One query remains an AND-composed set of independently negatable clauses.
Suggestions and completion
The Search and Documents query fields recognize an incomplete final qualifier. Suggestions cover filter names, Johnny.Decimal categories, tags, correspondents, document types, sensitivity values, date roles, andis:
states. Selecting one replaces the active token but does not run the search.
Limits
These are API contracts, not only browser limits.
Errors
Invalid queries return HTTP400 with code: "bad_query":
position is a zero-based byte offset in the submitted query. filter names
the failing qualifier. suggestions contains closed-vocabulary or ambiguity
help when available. The web app keeps the active form visible rather than
turning a failed query into an empty result.
URLs and MCP
Send the complete query in one URL-encodedq parameter:
Saved Views
New Views store one normalized query infilter_json.q. Visual category, tag,
correspondent, type, sensitivity, and document-date controls are converted into
the same language before persistence. Normalization quotes or escapes values
and is stable across parse/serialize round trips.
Older or imported Views may retain flat filter keys. Consumers such as Calendar
send view_id; the server loads an owned or shared View, applies its complete
filter, and reapplies document ACLs. Clients must not reconstruct partial View
scopes.
Snapshot Views instead store document_ids as an array of 1–100 positive,
deduplicated IDs. They preserve an exact document list while still reapplying
ACLs whenever opened or shared.
Archive research Views
Archive research does not ask the model to invent a rich query. An earlier prototype converted question words intoview_query, but RAG retrieval used
prefix-OR while saved search text used implicit AND; the resulting View
could differ from the cited documents.
Save retrieved documents as a view creates an exact snapshot from the
authorized documents shown under Evidence. A live View that should match future
documents is created explicitly with this query language.
- RAG retrieval finds evidence for one answer.
- Rich queries define live filters.
- Snapshot Views preserve the cited document list.