Multisource indexing: Create external indexing service

In this article you will find:

Goal

Hawksearch connector exposes an API for notifying external data sources while monitoring their indexing process. This way you can integrate the connector with external data source and modify the indexing flow based on data source indexing outcome. This article will provide information for creating an external indexing service compatible with Hawksearch connector.

Designing the external indexing service

Receiving a request from the Hawksearch connector

The service must expose a POST endpoint, which will receive and object with RequestId and IndexName from the request body.

METHOD: POST { "RequestId": "558ad504-9b2d-4b67-be4f-7ab9ed3028fb", "IndexName": "hawksearchindexname.20201020.112252.suffix" }

The response must follow the HTTP protocol status code semantics.

Sending a request to the Hawksearch connector

When the indexing process is completed, the service must send a PUT request to your-site-domain/hawk/index/status containing the RequestId and the IndexName received from the first request, and Status which notifies if the indexing is successful or failed.

You can set the status to either “successful” or “fail” depending on the indexing result.

METHOD: PUT { "RequestId":"558ad504-9b2d-4b67-be4f-7ab9ed3028fb", "IndexName":"hawksearchindexname.20201020.112252.suffix", "Action":"all", "Status":"successful", "ObjectType":"status", "Message":"Rebuild Hawksearch Index finished successfully" }

RequestId, IndexName and Status properties are required.