Modes for generating indexes

Goal

This article provides information about the generation of indexes, using Sitefinity and Hawksearch.

Prerequisite

Configure Hawksearch -

Overview

There are two ways to populate the index in Hawksearch:

  1. An automatic mode that works based on the index settings in Sitefinity and is supported by the latest version of Hawksearch that is based on Elastic.

  2. A manual mode that is managed by the Hawksearch Admin panel which is supported by all versions of Hawksearch.

Automatic mode

The automatic mode uses the Sitefinity Search service for creating an index. When Hawksearch is chosen as a search engine in the Sitefinity backend, an index is created from the backend page Administration → Search Indexes (your-website-url/Sitefinity/Administration/search).

From the Search Index page in the backend UI, there is an option to create a new index. By clicking the “Create index“ button a new page is being opened where a list with all content types is visualized. The chosen content types are those that are going to be indexed. Pressing the “Create“ button saves these specifications and creates a blank index without documents.

In order for the created blank index to be filled with documents, it should be reindexed. (From the Action drop-down → Reindex). This action will add documents to the index with information about the items. For each item from the chosen content types, a document is created. This document contains IdentityField with the Id of the item and a list of the fields, containing specific information about the record.

All these processes are happening through the Hawksearch API. For creating, deleting, updating etc. a call to the HawksearchClient is made and the corresponding action is processed.

When a record that has content type from these chosen for indexing, is being changed, the index is being updated. This way the search results are always up to date, with the latest changes.

For more information please see:

Extending Data Indexing in Hawksearch Elastic

Searching in Sitefinity

Manual mode

The manual mode uses the Export Functionality for generating an index. The content types that a user wants to be indexed should be first exported, then uploaded and at the end indexed.

The content types can be selected from the Hawksearch Admin page (your-website-url/Sitefinity/Administration/hawksearchconfig). There can be selected the basic content types and the dynamic types(if such have been created from the Module Builder) and also the sites from which the information to be taken.

There are 2 types of export: Full and Delta export.

  • The Full export takes all records of the selected content types in the Hawksearch Administration.

  • The Delta export takes only the records that have been modified since the last export.

There are also 2 options for executing the export process:

  • by clicking the buttons “Run Full Export Now“ or “Run Delta Export Now“

  • by scheduling a Full or Delta export for a particular time or after some minutes.

When clicking one of the “Now“ buttons the corresponding type of export is executed immediately.

The scheduling provides the option to set a time for exporting the records. A Delta Export can be set to be run at an interval of minutes and a Full Export can be set for Daily or Weekly run at a particular time.

After clicking one of the export buttons or a schedule is being set a group of 4 files will be generated.

You can add the path to your local folder where those files to be exported from Administration → Settings → Advanced Settings → Hawksearch → ExportDirectory

These files should then be uploaded to the Hawksearch backend and based on the information they have a reindex will be triggered.

As a result the content types described in the exported files, are being indexed. These records can be seen in the Hawksearch Result Widget.

For more information please see:

Â