Kentico: Multisource indexing: Creating an external indexing service

In this article you’ll find:

Prerequisites

Goal

The 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 an object with ApiKey and IndexName from the request body.

METHOD: POST { "ApiKey": "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 POST request to administration-site-domain/api/datasource/status containing the ApiKey received from the first request, and Status which notifies if the indexing is successful or failed.

You can set the status to either “Success” or “Fail” depending on the indexing result.

METHOD: POST { "ApiKey":"558ad504-9b2d-4b67-be4f-7ab9ed3028fb", "Status":"Success", "Message":"Rebuild Hawksearch Index finished successfully" }

ApiKey and Status properties are required.