GET /v1/autocomplete

Primary ranked search endpoint.

When the tenant is in search proxy mode, this path forwards to the connected search API. Hosted mode, merchandising, synonyms, personalization, and graph ranking are not applied.

Important query params

  • query required, minimum 1 character
  • index logical index ID, defaults to default
  • limit from 1 to 50
  • mode one of fts_only, vector_only, hybrid, fts_rerank
  • bypass_cache or X-Bypass-Cache to skip cached responses
  • filters as a JSON string for exact and range filtering
  • user_id for personalization-aware ranking
  • operators in query: see Query syntax

Query syntax

By default, every word in query must match. diaphragm pump returns only documents that contain both words. The last word matches as a prefix, so diaphragm pu also finds “pump”.

Two operators change this. Put them directly in front of a word, with no space.

Syntax Meaning Example
+word Required. The document must contain the word. +climate
-word Excluded. Documents containing the word are removed. -coal

Mixed queries. When a query has at least one +word, only the + words are required. The other words become optional: they do not filter results, but documents that contain them rank higher.

  • +climate policy: every result contains “climate”. Results that also contain “policy” rank first.
  • +climate +policy report: results contain both “climate” and “policy”. “report” only affects ranking.
  • climate policy: no +, so both words are required (the default).

Exclusions work with or without +:

  • climate -policy: results contain “climate” and never “policy”.
  • +policy brief -energy -coal: “policy” is required, “brief” is optional, and documents containing “energy” or “coal” are removed.

Excluded words match whole words only, never as a prefix. While a user is still typing -pol, documents containing “policy” are not removed.

Edge cases

  • A - counts as an operator only when a letter follows it. -20 sleeping bag searches for “-20”. Hyphenated words such as t-shirt are plain text.
  • A + counts as an operator only when a letter or digit follows it. c++ and a lone + are plain text.
  • A query that contains only excluded words, such as -policy, returns no results. Add at least one word to search for.
  • Spell correction keeps operators, so +runnig is corrected to +running. Synonyms are not expanded for excluded words. A synonym of a +word is added as an optional word.
  • In hybrid and vector_only modes, exclusions also apply to semantic matches.
  • Operators apply to /v1/autocomplete on hosted search only. In search proxy mode, the query is forwarded unchanged and the connected search API interprets it. /v1/typeahead does not support operators.

Response shape

The response includes:

  • normalized and optionally corrected query values
  • the effective mode used
  • suggestions with titles, subtitles, descriptions, URLs, images, price, currency, score, and extra metadata

Example

curl "https://api.suggestapi.com/v1/autocomplete?index=products&query=diaphragm%20pump&limit=8&mode=hybrid" \
  -H "x-api-key: <public-key>"

GET /v1/typeahead

Fast prefix suggestion endpoint for search-as-you-type experiences.

Important query params

  • query required
  • index logical index ID
  • limit from 1 to 50
  • bypass_cache or X-Bypass-Cache

Notes

  • optimized for low-latency suggestion UIs
  • supports spell correction and typo-tolerant fuzzy matching on hosted search
  • returns simpler suggestion payloads than /autocomplete
  • does not support query operators: + and - are matched as literal text, so +climate finds only suggestions that start with “+climate”
  • in search proxy mode, suggestions come from the connected search API