Goal
This article provides information about the best practices for building Hawksearch Elastic integrations with Sitefinity.
Setup the Hawksearch engine.
In order to use the Hawksearch service in Sitefinity, you will need a configured Hawksearch engine.
Working with the Elastic Version
With the Elastic version of the connector developers will use the Sitefinity’s Hawksearch service for creating, updating and deleting indexes.
Hawksearch provides two index slots for development instance and there are things that should be considered while developing.
Creating Fields in the Hawksearch Engine
The connector creates fields in the Hawksearch engine out of the box. The process of creating the field occurs during the creation of the index. If you want to create additional fields, you can do so from the Administration → Search Indexes (your-website-url/Sitefinity/Administration/search) and you can add additional fields in the Advanced section of the Search Index editor page.
The index must be reindexed in order to create the fields .
Creating an Index
If more than one developer creates an index at the same time, there is a risk that one of the indexes will not be created. As Hawksearch currently provides two index slots for dev environment there is a risk that one or more indexes will not be created.
Reindexing an Index
If more than one developer reindex at the same time, there is a risk that one of the indexes will not be created. Hawksearch currently provides two index slots in the dev environment, and if more than two indexes are created during reindexing, there is a risk that one or more indexes will not be created.
Deleting an Index
If more than one developer is working on the same engine, deleting of the indexes should be collaborated with others, because of data lost.
Manipulating Sitefinity’s Content Items
When you create, update, or delete items in Sitefinity, updates are automatically reflected in the Hawksearch index. If more than one developer uses the same index, they should be notified for the changes.
Index Mapping
Using index mapping provided from the Hawksearch admin page -> Index Mappings (your-website-url/Sitefinity/Administration/indexmappings) more than one developer can use a single index. Developers need to know that if an index is re-indexed, a new index will be created on the engine and all developers who are mapped to this index will not be able to use it due to the difference in the name of the index. In this case, the mapping needs to be updated.
Setting a Current Index
Since there are no direct problems with the existence of the current index, there are things to keep in mind:
Index set as current cannot be deleted. You cannot delete the current index, you can only swap it. You can set current index from Hawksearch admin page -> Hawksearch Indexes (your-website-url/Sitefinity/Administration/hawksearchindexes).
Index set as current cannot be re-indexed. If you try to reindex an index that is set to current, a new index will be created with the same suffix but with a different stamp. If the creation of the new index exceeds the maximum number of indexes (2 for development), the new index will not be created and the reindexing will fail.
Once set the current index cannot be undone. There will always be an index set as current in the respective engine.