Goal
The Sitefinity connector provides a mechanism for notifying external data sources for the start of the indexing procedure. This way, you can use multiple sources to add items to the Hawksearch index created by Sitefinity.
...
In order to activate this functionality you will need to select Enable Indexing From External Data Source checkbox in Advanced Settings → Hawksearch (your-site-domain/Sitefinity/Administration/Settings/Advanced).
Add additional data sources
After enabling the functionality you will need to create a new External Service. You can do that add additional data sources from Advanced Settings → Hawksearch -> ExternalServices DataSources submenu. You should provide the External Service with Source Id, Name and Url. The Url value will be used from Sitefinity to send a request at the external service.
Setup external indexing service
The External Service Data Source with Name, Api Key, Url, Severity and Timeout interval.
Name - provide unique name for the data source
Api Key - provide a unique Api Key
Url - the Hawksearch connector will use this Url to send a POST request to the data source
Severity - the values for severity are “Low” and “Critical”. If the data source is with Low severity and indexing failed Sitefinity will continue the indexing procedure as normal, but if the severity is set to Critical this will stop the indexing procedure.
Timeout interval - you can set a timeout interval which if exceeded the the indexing will continue.
Setup data source service
The Data Source must expose a POST endpoint, which will receive and object with Id and IndexName from the request body.
Code Block |
---|
METHOD: POST { "IdApiKey": "558ad504-9b2d-4b67-be4f-7ab9ed3028fb", "IndexName": "hawksearchindexname.20201020.112252.suffix" } |
When the indexing process is completed, the service must send a PATCH request to your-site-domain/external-datahawk/indexesindex/status containing the service Id and the index name received in from the first request, and Status which notifies if the indexing is successful or failed.
Note |
---|
You can set the status to either success or fail depending on the indexing result. |
Code Block |
---|
METHOD: PATCH { "Id": "558ad504-9b2d-4b67-be4f-7ab9ed3028fb", "IndexName": "hawksearchindexname.20201020.112252.suffix", "Status": "success" } |
When all external services data sources complete their indexing procedure or when the timeout limit is exceeded, Sitefinity will continue with its indexing procedure, unless data source with Critical severity failed to index correctly.