Configuration

Get Started

The connector is configurable inside the project’s Web.config file.

In order to configure the connector, add the following sections inside element:

<section name="hawksearch" type="Optimizely.Hawksearch.Connector.Utils.HawksearchConfigurationSection, Optimizely.Hawksearch.Connector" />
<section name="engines" type="Optimizely.Hawksearch.Connector.Utils.HawksearchEnginesCollection, Optimizely.Hawksearch.Connector" />

Then, inside the <system.net > element, you can fully customize the behavior of the connector. An example:

<hawksearch 
	indexsuffix="dev"
	shouldprintignoredfields="true"
	indexingenvironment="https://indexing-dev.hawksearch.net"
	searchenvironment="https://searchapi-dev.hawksearch.net"
	dashboardenvironment="https://dev.hawksearch.net"
	trackingenvironment="https://tracking-dev.hawksearch.net"
	recommendationsenvironment="https://recs-dev.hawksearch.net"
	contentreadpagesize="1000"
	itemindexingapilimit="125"
	hierarchyindexingapilimit="125"
	ignoretracking="false"
	variantindexingstrategy="VariantAttributesRollUp"
	eventedindexingenabled="true"
	enablepriceindexing="true"
	enableinventoryindexing="true"
	hidefindadminscreens="true"
	dbconnectionstringname="EPiServerDB">
	<engines>
		<engine languageid="en" enginename="Your_Engine_Name" apikey="Your_Api_Key" trackingkey="Your_Tracking_Key" databaseid="Your_Databaseid"></engine>
		<engine languageid="fr" enginename="Your_Engine_Name" apikey="Your_Api_Key" trackingkey="Your_Tracking_Key" databaseid="Your_Databaseid"></engine>
	</engines>
</hawksearch>
  • section has a series of attributes (presented in the table below) describing the general connector behavior. It also contains a nested section composed of elements.
  • section has a series of attributes (presented in the table below) specific to the Hawksearch engine, commonly identified by the language that engine operates on. This implementation is based upon the idea that every language has its own engine, each one of these engines being accessible from the Hawksearch Dashboard.

Configurations

  • General: section
AttributeRequiredDefault ValueExplanation
indexsuffixNo““Suffix of all Hawksearch indexes
shouldprintignoredfieldsNofalseIf enabled, it will print the fields which have no correspondent in the Hawksearch engine, but were attempted to be indexed anyway. These ignored fields can be seen in the scheduled job’s message and logs
indexingenvironmentYes““API Endpoint for Indexing
(provided by Hawksearch)
searchenvironmentYes““API Endpoint for Searching
(provided by Hawksearch)
dashboardenvironmentYes““Location of the dashboard
(provided by Hawksearch)
trackingenvironmentNo““API Endpoint for Event Tracking
(provided by Hawksearch)
recommendationsenvironmentNo““API Endpoint for Recommendations
(provided by Hawksearch)
contentreadpagesizeNo600Minimum value: 1
The number of items from the IndexingQueue table being read/processed at once
itemindexingapilimitNo125Minimum value: 1

Maximum value: 125

Hawksearch upper limit when indexing items
hierarchyindexingapilimitNo125Minimum value: 1

Maximum value: 125

Hawksearch upper limit when indexing hierarchies
ignoretrackingNofalseX-HawkSearch-IgnoreTracking
Header value for search requests
variantindexingstrategyNo“VariantAttributesRollUp“Available values:

- “VariantAttributesRollUp“
- “SeparateDocuments“
- “VariantAsChildOfParent“

Determines the indexing strategy for product-variant relationships
eventedindexingenabledNotrueIf enabled, it will add any (specified) change to content (both CMS and Commerce) in the IndexingQueue table in order to be processed later by the Incremental Indexing Job. Note that incremental (delta) indexing will not be available if this is set to “false”.
enablepriceindexingNofalseIf enabled, it will index the prices for entries that support pricing (such as variants or packages).

For Variant as Separate Document indexing strategy, both variants and packages have their prices indexed out of the box.
For other strategies, only packages will have their prices indexed out of the box. To index variant prices in these strategies, custom code must be written to extend the indexing pipeline. Check How to Extend Handlers and How To Extend Pipes.
It will also add event handlers to register changes for prices in the IndexingQueue table
enableinventoryindexingNofalseIf enabled, it will index the inventories for entries that have inventories (such as variants or packages).

For Variant as Separate Document indexing strategy, both variants and packages have their inventories indexed out of the box.
For other strategies, only packages will have their inventories indexed out of the box. To index variant inventories in these strategies, custom code must be written to extend the indexing pipeline. Check How to Extend Handlers and How To Extend Pipes.
It will also add event handlers to register changes for inventories in the IndexingQueue table
hidefindadminscreensNofalseIf enabled, it will hide the “Search & Navigation” menu item from the global menu. This menu item is visible if Optimizely Find (former EpiFind) is installed in the project
dbconnectionstringnameNo“EPiServerDB“The target database where the IndexingQueue table will be created. The table contains changes for content later picked up by the Incremental Indexing Job. If nothing is specified, the default CMS database will host this table
  • Engine specific: section
AttributeRequiredDefault ValueExplanation
languageidYes““This field must be a 1:1 mapping to the Optimizely language the engine operates on. For instance, if your site language ids are “en” (English) and “fr” (French), then these will be used as the available values for this field
enginenameYes““Name of the engine
(provided by Hawksearch)
apikeyYes““Engine’s API Key
(provided by Hawksearch)
trackingkeyYes““Engine’s Tracking Key

(provided by Hawksearch)
databaseidYes““Engine’s Database Id
(provided by Hawksearch)

🚧

Limitation

A Hawksearch Engine can’t be reused to store information for multiple languages!

Troubleshooting

If running [Hawksearch] Full Indexing Job from the Optimizely CMS → Admin interface results in error.

Double check the languageid field(s) and make sure the 1:1 mapping between the Optimizely language and the Hawksearch engine is correct.