Hawksearch v4.0 - Autocomplete API
Autocomplete is the quick suggestion feature also termed search-as-you-type. Generation information on this is available at - https://bridgeline.atlassian.net/wiki/spaces/HSKB/pages/3462493388
Following article depicts the API format for Autocomplete feature on Hawksearch v4.0
REST API endpoints:
Dev - https://searchapi-dev.hawksearch.net/api/autocomplete
Test - https://searchapi-test.hawksearch.net/api/autocomplete
Prod - https://essearchapi-na.hawksearch.com/api/autocomplete
Autocomplete V3
The Autocomplete V3 method is to be called when users have typed part of the keyword or the keyword is empty.  The third version of the autocomplete method, contains minor modifications in the response structure (products object) .
To enable Autocomplete V3 on the Dashboard, please follow Update Top Product Categories instructions: Auto-Complete#Complete-UpdateTopProductCategories
Request
Endpoint | Method | Header Key |
---|---|---|
api/v3/autocomplete | POST | Content-Type: application/json |
X-HawkSearch-IgnoreTracking: true/false |
X-HawkSearch-IgnoreTracking key disables tracking in this instance. The value is set to false by default
Â
Response
Autocomplete V2
The Autocomplete method is to be called when users have typed part of the keyword.  The second version of the autocomplete method, contains minor modifications in the response structure (products object) .
Request
Endpoint | Method | Header Key |
---|---|---|
api/v2/autocomplete | POST | Content-Type: application/json |
X-HawkSearch-IgnoreTracking: true/false |
X-HawkSearch-IgnoreTracking key disables tracking in this instance. The value is set to false by default
Â
Response
Autocomplete
The Autocomplete method is to be called when users have typed part of the keyword. This is a full API version of the autocomplete.
Request
Endpoint | Method | Header Key |
---|---|---|
api/autocomplete | POST | Content-Type: application/json |
X-HawkSearch-IgnoreTracking: true/false |
X-HawkSearch-IgnoreTracking key disables tracking in this instance. The value is set to false by default
Â
Name | Data Type | Required | Description | Source or Admin Section |
---|---|---|---|---|
ClientGuid | String | required | API Client Guid | Tracking Key found in Admin > Account Info |
Keyword | String | optional (from V3) | Search term entered by a user. If keyword is not included, all items configured to be returned will be returned. When this parameter is populated, the results will be matched against this term by the search engine. | Entered by the user |
IsInPreview | Boolean | optional | This is used by the Hawksearch Preview to set to true will display elements in a preview mode. | Â |
Type | enumerator: Category, Product, Content, Popular | optional | To control the ability of returning numbers of rows, 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. | Configured in Workbench > Keyword Search > Autocomplete |
ProductCount | Numeric | optional | The maximum number of results to return for selected ‘Type’ (see above) |  |
DisplayFullResponse | Boolean | optional | Flag set to true will display also full Document object for Products and Content suggestions | Â |
FieldOverride | Array of strings | optional | An array of field names that Hawksearch will return in a response |  |
ClientData | Client Data object | optional | Â | |
Query | String | optional | Use this to perform searches on one or more specific fields without needing to create facets for them. | For examples, see |
IndexName | string | optional | The name of the index against which the search must be performed | When the index was created, the IndexName was returned in the response from the Create method or the GetCurrentIndex method. This is also available on the Preview tab in dashboard. |
CustomUrl | string | optional | Landing page Custom URL. When this parameter is populated, the resulting response will be determined by the configuration of the corresponding Landing Page. | This matches the Custom URL field within a Landing Page. Can be found Workbench > Merchandising > Landing Pages Keyword and CustomURL should never be passed in the same request. |
PageId | number | optional | The unique identifier of the landing page(unique across the whole system) | Â |
SortBy | string | optional | The SortBy value corresponds with the Sorting configuration in the Hawksearch Workbench. This value needs to be one of the values configured within the Sorting/Pagination section of the Workbench. If no SortBy value is sent, the default value from the Workbench will be used. The default can vary depending on the sorting set triggered. | Valid values are configured in Workbench > Data Configuration > Sorting/Pagination |
SortingSetCode | string | optional | SortingSetCode can be used to specify a particular sorting set that should be used for the results. If not passed, the engine will evaluate the rules for each sorting set and pick the first applicable one. | Valid values are configured in Workbench > Data Configuration > Sorting/Pagination > Sorting Code |
Â