Search
All search routes take a search key, or a scoped key on an index with per-record access control. They return the same response shape: hits, total, facets and timing.
Typeahead
Send the text typed so far. Captain answers each keystroke with spelling correction and prefix matching.
curl
Python
TypeScript
Cancel the previous request when a new keystroke arrives, and draw only the reply to the latest one.
Filters, sort and pages
filter takes an expression over the fields returned by List Filters, which also gives the operators each field accepts:
Operators: =, !=, <, <=, >, >=, IN, NOT IN, BETWEEN, EXISTS(field), combined with AND, OR, NOT and parentheses.
An expression that names an unknown field, or uses an operator the field does not support, returns 400 FILTER_INVALID with the position of the problem and what could come there.
sort: order by one sortable field,{"field": "price", "order": "asc"}, instead of relevance.pageandper_page: page through results, from page0.prefer: lift records that match a condition without removing the others.group_by: one hit per value of a field, such as one product per variant family.
Browse
curl
Python
TypeScript
Similar records
curl
Python
TypeScript
Multiple searches
Each entry names an index, a route (search, typeahead or browse, default search) and that route’s body.
curl
Python
TypeScript
Per-record access control
When records carry access lists, searches use scoped keys. A scoped key is minted for one end user and returns only the records that user may see. Suggestions and facet counts respect the same rule. Scores are never returned to a scoped key.
A write key can set a record’s access list, including making it public. Check the access fields in the integration before going live.