Using Dashboard API to Rebuild Indexes

Important:

Disambiguation: Depending on the version of HawkSearch used, method of integration, and the presence of data feed files for indexing, you may need to perform indexing as per this article or Hawksearch v4.0 - Indexing API. Please contact HawkSearch for any clarifications.

 

Overview

This API allows you to trigger an index rebuild job in Hawksearch dashboard.

 

Full Index

Request: POST request with empty body to the API below:

 

POST /api/v10/index HTTP/1.1 Host: dashboard-na.hawksearch.com X-HawkSearch-ApiKey: USE_YOUR_API_KEY Cache-Control: no-cache {}

 

Index with Arguments - Only exists in dev environment

Request: POST request with empty body to the API below:

 

POST /api/v10/index/trigger HTTP/1.1 Host: dev.hawksearch.net X-HawkSearch-ApiKey: USE_YOUR_API_KEY Cache-Control: no-cache { "args":"partial" }

 

Response: The response is an array of string objects, every object being a series of key-value pairs. Description of the data is as follows:

No

Key

Description

Value Type

No

Key

Description

Value Type

1

NotificationId

The unique identifier asssigned to the index rebuild request made

Number

2

Title

Task name

String

Example: Requested Re-Indexing (API)

3

Message

Response message from the server

String

Example: Requested Re-Indexing (API)

4

NotificationType

Indicates whether this was indexing related or not

String

Example: indexing

5

Status

The current indexing status

One of the 8 possible values:

new, pending, processing, queue, success, error, duplicated, suspended

6

AdminId

Admin account id from which the index rebuild request was raised

Numeric

7

Provider

Indexing provider - this is debugging info used by HawkSearch

Alphanumeric

8

FacetHandler

Internal handler associated with the field

Alphanumeric

9

Serialized

Serialized object

Alphanumeric

10

ErrorMessages

Error messages associated with the rebuild job

Alphanumeric

11

Args

Optional list of custom arguments

List of key value pair list Example: “arg_name“:”arg_value”

 

{ "NotificationId": 122924, "Title": "Requested Re-Indexing (API)", "Message": "Requested Re-Indexing (API)", "NotificationType": "indexing", "Status": "new", "AdminId": 113, "Provider": "Contracts.IndexNotification", "Serialized": "CgsIhuSGoufqtzkQBRIECAEQDyIuChJSZXF1ZXN0ZWQgSW5kZXhpbmcSCwiG5Iai5+q3ORAFGgsIhuSGoufqtzkQBQ==", "ErrorMessages": null, "Args": { "indextype": "partial" } }

 

Please review : Best Practices to rebuild index