POST /search/autocomplete
Perform a synchronous autocomplete search query against a SearchIndex.
Purpose-built for type-ahead input. The request shape is deliberately narrow: there is
no size (the server caps every response at 8 hits), no from
/ search_after (a dropdown does not paginate), no sort
(results are ordered by relevance), and no aggregations /
responseParts (autocomplete returns matching hits
only). For anything beyond a type-ahead lookup — scored relevance, faceting, totals,
deep pagination — use the async
POST /search/query/async/start endpoint
with SearchIndexQuery
instead.
Allowlisted top-level keys
Only query and _source are accepted on the
searchQuery; any other top-level key returns HTTP 400 naming the offender.
query — required. The top-level clause must be one of
prefix,
match_phrase_prefix, or
match_bool_prefix;
any other clause type (including compound clauses such
as bool) is rejected with HTTP 400. The same per-clause guarantees as the
async search endpoint apply: scripts, cross-index references, and the
wrapper form are rejected; depth, total-clause, and inline
terms array length are capped; prefix values starting with
* or ? are rejected (a leading wildcard forces a full
inverted-index scan).
_source — optional. Source filter; same shape as on
SearchQuery._source.
Narrowing this to the columns the dropdown actually displays reduces response size,
especially for wide indexes.
Field references
On text-typed columns (STRING, STRING_LIST, MEDIUMTEXT, LARGETEXT, LINK), use
{columnName}.keyword for prefix and
match_phrase_prefix (these are exact-match operations against the raw /
non-tokenized sub-field). match_bool_prefix uses the bare column name (it
analyzes the input). Numeric / boolean / keyword columns always use the bare name.
Example — prefix match on the title.keyword sub-field:
"searchQuery": { "query": { "prefix": { "title.keyword": "can" } } }
Resource URL
https://repo-prod.prod.sagebase.org/repo/v1/search/autocomplete
| Resource Information | |
|---|---|
| Authentication | Required |
| Required OAuth Scopes | view |
| HTTP Method | POST |
| Request Object | SearchAutocompleteRequest (application/json) |
| Response Object | SearchQueryResults (application/json) |