Notice !

Results are cached for 2 minutes and changes (like updating a document) will not be applied for the same query until 10 minutes pass.
GET /api/v2/projects/{project}/collections/{collection}/autocomplete/
GET /api/v2/projects/{project}/collections/{collection}/autocomplete/{handler}
You can use the first endpoint to access an autocomplete query configured with a request handler called “suggest”. Otherwise, you must specify the request handler as in the second endpoint.
  1. {project} is your project name, e.x wptest.
  2. {collection} is the name of collection of documents you want to search in, e.x posts.
  3. {handler} OPTIONAL - is the autocomplete handler name, suggest by default.

Querystring parameters:

  1. q: the search query, e.x ?q=la.
  2. filter: a list of filters, e.x ?filter=tags:"Tech"&filter=tgas:"Computer".
  3. limit: how many documents to fetch (used for pagination), e.x ?limit=5.
  4. sort: You can sort the search results using the sort parameter by defining which field you want to sort the results. it can be ascending(asc) or descending(desc), e.x ?sort=tags desc.
  5. session_id: a unique identifier for a user session, e.x ?session_id=1xHsxW342.
  6. user_id: a unique identifier for a user, e.x ?user_id=1.
  7. user_ip: user ip address, e.x ?user_ip=
  8. user_country: user country code, e.x ?user_country=DE.

Example request:

  &sort=date desc

Example response:

  "time": 12,
  "code": 200,
  "response": {
    "found_documents": 1,
    "results": [
        "date": "2017-05-15T14:38:08.000+0000",
        "phrase": "Example using the autocomplete api",
        "suggestion_type": "navigational",
        "id": "5147",
        "category": ["Travel"],
        "url": "http://mysite.com/posts/example-auto-api/"
        "phrase": "posts by Example",
        "suggestion_type": "filter",
        "filters": ["authors_sa:\"Example\""]
    "facets": null,
    "spelling": null

There are two suggestion types:
  1. navigational: this type has a direct link for a post in your website.
  2. filter: this types has a list of filters which you should use in the search query if the user hits this suggestion.