Configuring the Connector

The connector is configurable inside the project’s Web.config file.
In order to configure the connector, add the following sections inside <configuration> <configSections> 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 <http://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>

 

  • <hawksearch> section has a series of attributes (presented in the table below) describing the general connector behavior. It also contains a nested <engines> section composed of <engine> elements.

  • <engine> 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: <hawksearch> section

Attribute

Required

Default Value

Explanation

Attribute

Required

Default Value

Explanation

indexsuffix

No

““

Suffix of all Hawksearch indexes

shouldprintignoredfields

No

false

If 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

indexingenvironment

Yes

““

API Endpoint for Indexing

(provided by Hawksearch)

searchenvironment

Yes

““

API Endpoint for Searching

(provided by Hawksearch)

dashboardenvironment

Yes

““

Location of the dashboard

(provided by Hawksearch)

trackingenvironment

No

““

API Endpoint for Event Tracking

(provided by Hawksearch)

recommendationsenvironment

No

““

API Endpoint for Recommendations

(provided by Hawksearch)

contentreadpagesize

No

600

Minimum value: 1
The number of items from the IndexingQueue table being read/processed at once

itemindexingapilimit

No

125

Minimum value: 1

Maximum value: 125

Hawksearch upper limit when indexing items

hierarchyindexingapilimit

No

125

Minimum value: 1

Maximum value: 125

Hawksearch upper limit when indexing hierarchies

ignoretracking

No

false

X-HawkSearch-IgnoreTracking
Header value for search requests

variantindexingstrategy

No

“VariantAttributesRollUp“

Available values:

  • “VariantAttributesRollUp“

  • “SeparateDocuments“

  • “VariantAsChildOfParent“

Determines the indexing strategy for product-variant relationships

eventedindexingenabled

No

true

If 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”.

enablepriceindexing

No

false

If 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

enableinventoryindexing

No

false

If 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

hidefindadminscreens

No

false

If 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

dbconnectionstringname

No

“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: <engine> section

Attribute

Required

Default Value

Explanation

Attribute

Required

Default Value

Explanation

languageid

Yes

““

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

enginename

Yes

““

Name of the engine

(provided by Hawksearch)

apikey

Yes

““

Engine’s API Key

(provided by Hawksearch)

trackingkey

Yes

““

Engine’s Tracking Key

(provided by Hawksearch)

databaseid

Yes

““

Engine’s Database Id

(provided by Hawksearch)

Limitations

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 following error:

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