/api/v1/suggest
GET /suggest — Auto-suggest with the request encoded in the URL.
GET /suggest — Auto-suggest with the request encoded in the URL.Identical semantics to POST /suggest; the JSON request is
passed verbatim as the BODY query parameter. Useful for
front ends that prefer not to send a GET body.
The query parameter name is BODY (uppercase) — the
handler reads r.URL.Query().Get("BODY") case-sensitively, so a
lowercase body=... is not picked up; an absent or empty BODY
then fails JSON parsing and returns a 400.
Access token in the Authorization header:
Authorization: Bearer <token>.
JSON-encoded SuggestRequest. See the request schema on
POST /suggest for the field set.
Suggestion envelope.
Auto-suggest response — returned by GET /api/v1/suggest and
POST /api/v1/suggest. Carries diagnostic timing info plus a
suggestions envelope with the three optional result sets the
request opted into.
Time the search index spent on the request, in milliseconds. Excludes fylr-side serialisation overhead.
True if the request reached the per-request timeout. Partial
results may still be present in suggestions.
Malformed request — invalid JSON in BODY, an objecttype in
objecttypes or linked_objecttypes that does not exist, an
unresolvable entry in fields, or an unknown tokens_mode
(the latter only rejects when token suggestions run, i.e.
unless tokens is false). All return ServerGeneric /
400; the handler emits no other status.
POST /suggest — Auto-suggest with the request as a JSON body.
POST /suggest — Auto-suggest with the request as a JSON body.Access token in the Authorization header:
Authorization: Bearer <token>.
Auto-suggest request — accepted as the JSON request body of
POST /api/v1/suggest, and as the value of the BODY query
parameter on GET /api/v1/suggest. Drives token and / or field
completion through the search index.
Each result kind is opted into independently: token suggestions
(tokens, on by default unless tokens is false), per-field
value matches (fields_suggest: true, which also needs a non-empty
fields), and linked-object descriptors (a non-null
linked_objecttypes).
The user's current input. Optional; defaults to the empty
string. Tokenised (whitespace-split) unless
tokens_dont_split_query is set. The last token is treated as
the partial term to complete.
If true, the query is sent verbatim — the engine does not split it on whitespace. Useful when the input is a multi-word phrase that should match as a single token.
falseIf true, null, or omitted, return token completions in
suggestions.tokens. Set to false to suppress them. Independent
of fields_suggest.
Field paths whose values should be considered as completion
candidates. Each entry is a fully-qualified field name
(e.g. picture.title, _tags.tag.name). Must be non-empty to
get any per-field suggestions: combining fields_suggest: true
with an empty fields yields no suggestions.fields (it is a
silent no-op, not an error).
If true, also return per-field completions in
suggestions.fields — one entry per matching value, with the
list of system-object ids that hold it.
falseRestrict suggestions to objects of these objecttypes. Empty / omitted means no restriction.
Restrict suggestions to objects in exactly these pools — there is no automatic sub-pool inclusion. Empty / omitted means no restriction.
Restrict token / field matching to these language-tagged
sub-fields (e.g. de-DE, en-US). Empty means consider all
languages enabled on the instance.
If set, the engine also returns linked_objects — full
ObjectApi entries of the named objecttypes that match the
query. Useful for autocomplete pickers that need to show the
target object inline.
If true, the query string is interpreted as a wildcard pattern
(* and ?) rather than a prefix. Applies to token
suggestions only; the field and linked-object searches ignore
it.
falseToken-matching mode. One of:
- `` (empty) /
ngram— substring match (default). edgengram— prefix match.exact— exact-term match.
Any other value is rejected with a 400.
Per-request timeout in milliseconds passed through to the search index. Zero / omitted uses the indexer's default.
Maximum number of suggestions to return (per kind). Defaults to 10 when unset or zero.
10Suggestion envelope.
Auto-suggest response — returned by GET /api/v1/suggest and
POST /api/v1/suggest. Carries diagnostic timing info plus a
suggestions envelope with the three optional result sets the
request opted into.
Time the search index spent on the request, in milliseconds. Excludes fylr-side serialisation overhead.
True if the request reached the per-request timeout. Partial
results may still be present in suggestions.
Malformed request — invalid JSON in the request body, an
objecttype in objecttypes or linked_objecttypes that does
not exist, an unresolvable entry in fields, or an unknown
tokens_mode (the latter only rejects when token suggestions
run, i.e. unless tokens is false). All return
ServerGeneric / 400; the handler emits no other status.
Last updated