---
title: "Autocomplete"
method: POST
path: "/api/v2/autocomplete"
tags: ["AutocompleteV2"]
---

# Autocomplete

`POST /api/v2/autocomplete`

The Autocomplete method is to be called when users have typed part of the keyword. The endpoint returns suggestions from HawkSearch.

## Request body

- AutocompleteRequest — Autocomplete params
  - `FacetSelections` object — Selected facets names with values
  - `CustomUrl` string — Landing page Custom URL
  - `SortBy` string — Sort by a filed name
  - `SortingSetCode` string — Set sorting set evaluation override
  - `PageId` integer
  - `NestedId` string — Nested Id
  - `ClientGuid` string — API Client Guid
  - `Keyword` string — Search term. If term isn’t included we search everything
  - `IsInPreview` boolean — Flag set to true will display elements in a preview mode. Flag set to false will display live data
  - `Type` 0 | 1 | 2 | 3 — To control the ability of returning numbers of rows from Elastic Search, both ‘Type’ and ‘ProductCount’ parameters needs to be set e.g.: Type=Category, ProductCount=2. Search response will return max 2 items for category suggestions.
  - `ProductCount` integer — The maximum number of results to return for selected ‘Type’ (see above)
  - `DisplayFullResponse` boolean — Flag set to true will display also full Document object from Elastic for Products and Content suggestions
  - `FieldOverride` string[] — An array of field names that Elastic Search will return in a response
  - `SmartBar` SmartBar — Smart Bar turns On/Off: 'Boost and Bury', 'Visibility Rules', 'Presonalized Boost', 'Popularity Boost', 'Item Pin Processor' , 'KeywordReplacement'
    - `BoostAndBury` boolean
    - `VisibilityRules` boolean
    - `PersonalizedBoost` boolean
    - `PopularityBoost` boolean
    - `ItemPin` boolean
    - `PopularitySalesBoost` boolean
    - `PopularityAdd2CartBoost` boolean
    - `PopularityLandingPageBoost` boolean
    - `KeywordReplacement` boolean
    - `PreviewDate` string, date-time
  - `ClientData` ClientData
    - `VisitorId` string, uuid
    - `VisitId` string, uuid
    - `Custom` object
    - `ExtendedCustom` object
    - `PreviewBuckets` integer[]
    - `Source` string
    - `Origin` Coordinate
      - `Latitude` number, double
      - `Longitude` number, double
    - `ZipCode` string
  - `IndexName` string — Search a given index
  - `Query` string — Custom search query
  - `BoostQueries` BoostQueries[]
    - `Query` string
    - `Boost` number, float

## Response `200`

OK

- object

---

[API](https://skmtc.net/hawksearch/apis/hawksearch-elasticsearch-indexingapi.md) · [All operations](https://skmtc.net/hawksearch/apis/hawksearch-elasticsearch-indexingapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hawksearch/hawksearch-elasticsearch-indexingapi/revisions/24cba7bf3468/schema)
