Prepare the Main Sitecore Content Manager for a Scaled Environment
Prepare the Main Sitecore Content Manager for a Scaled Environment
Once you correctly built the whole Sitecore infrastructure, you may proceed to configure Coveo for Sitecore on your main content management instance (CM1).
Step 1: Configure an Additional Database Search Index
Sitecore suggests adding a pub
database, as illustrated in Sitecore Infrastructure Setup.
Whether this additional database is called pub
or something else (e.g., web2
), you must add a new index definition for it.
-
On
CM1
, open theCoveo.SearchProvider.Custom.config
file, depending on your Sitecore version:Sitecore 9 and 10
The
Coveo.SearchProvider.Custom.config
file is located in the<SITECORE_INSTANCE_ROOT>\App_Config\Include\Coveo\
folderSitecore 7 and 8
The
Coveo.SearchProvider.Custom.config
file is located in the<SITECORE_INSTANCE_ROOT>\Website\App_Config\Include\Coveo\
folder.You shouldn’t modify the
Coveo.SearchProvider.config
file directly, as it may cause unexpected upgrade issues and loss of configuration. -
Inside the
contentSearch/configuration/indexes
element, add another<index>
element as the last child by copy-pasting the code block for your Sitecore version.NoteFor Sitecore 9 and 10 instances, configuration patching to disable indexing on CD servers is included directly in the
SITECORE 9 AND 10
code block below. For Sitecore 7 and 8 instances, this patching is handled further in the procedure, in a separate step (i.e., step 6).Sitecore 9 and 10
Copy and paste the following content to create the new child of the
<indexes>
element:<index id="Coveo_pub_index" type="Coveo.SearchProvider.ProviderIndex, Coveo.SearchProvider" patch:before = "*[3]"> <param desc="p_Name">$(id)</param> <configuration ref="coveo/defaultIndexConfiguration" /> <locations hint="list:AddCrawler"> <crawler name="ContentCrawler" type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch"> <database>pub</database> <root>/sitecore/content</root> <stopOnError>true</stopOnError> </crawler> <crawler name="MediaLibraryCrawler" type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch"> <database>pub</database> <root>/sitecore/media library/Files</root> <stopOnError>true</stopOnError> </crawler> </locations> <strategies hint="list:AddStrategy"> <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/coveoOnPublishEndAsyncPub"/> <strategy role:require="ContentDelivery" name="coveoOnPublishEndAsyncPub" type="Sitecore.ContentSearch.Maintenance.Strategies.ManualStrategy, Sitecore.ContentSearch"> <param desc="database"> <patch:delete /> </param> <CheckForThreshold> <patch:delete /> </CheckForThreshold> </strategy> </strategies> <propertyStore ref="coveo/databasePropertyStore" param1="$(id)"/> <enableItemLanguageFallback>false</enableItemLanguageFallback> <enableFieldLanguageFallback>false</enableFieldLanguageFallback> </index>
Sitecore 7 and 8
Copy and paste the following content to create the new child of the
<indexes>
element:<index id="Coveo_pub_index" type="Coveo.SearchProvider.ProviderIndex, Coveo.SearchProvider" patch:before = "*[3]"> <param desc="p_Name">$(id)</param> <configuration ref="coveo/defaultIndexConfiguration" /> <locations hint="list:AddCrawler"> <crawler name="ContentCrawler" type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch"> <database>pub</database> <root>/sitecore/content</root> <stopOnError>true</stopOnError> </crawler> <crawler name="MediaLibraryCrawler" type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch"> <database>pub</database> <root>/sitecore/media library/Files</root> <stopOnError>true</stopOnError> </crawler> </locations> <strategies hint="list:AddStrategy"> <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/coveoOnPublishEndAsyncPub"/> </strategies> <propertyStore ref="coveo/databasePropertyStore" param1="$(id)"/> <enableItemLanguageFallback>false</enableItemLanguageFallback> <enableFieldLanguageFallback>false</enableFieldLanguageFallback> </index>
-
Apply the following changes to the
<index>
element that you just added.-
The
id
attribute is set toCoveo_pub_index
in the copied block. If your additional database isn’t namedpub
, change theid
attribute value to reflect the name of your database (e.g.,Coveo_web2_index
). -
The text value of the
<database>
elements in the copied block ispub
. If your additional database isn’t namedpub
, change the text value to reflect the name of your database (e.g.,<database>web2</database>
).
-
-
Add the following
<indexConfigurations>
element as an immediate child of the<contentSearch>
element:<indexConfigurations> <indexUpdateStrategies> <coveoOnPublishEndAsyncPub name="coveoOnPublishEndAsyncPub" type="Sitecore.ContentSearch.Maintenance.Strategies.OnPublishEndAsynchronousStrategy, Sitecore.ContentSearch"> <param desc="database">pub</param> <CheckForThreshold>true</CheckForThreshold> </coveoOnPublishEndAsyncPub> </indexUpdateStrategies> </indexConfigurations>
-
The text value of the
<param>
element in the block you just copied ispub
. If your additional database isn’t namedpub
, change the text value to reflect the name of your database (e.g.,<param desc="database">web2</param>
).If you make changes to the
<coveoOnPublishEndAsyncPub>
element (i.e., to the element name or itsname
attribute value), ensure you match these changes in the child<strategy>
element(s) of the<index>
element you added earlier. -
(For Sitecore 7 and 8 only)
You need to prepare a patch for the
coveoOnPublishEndAsyncPub
strategy to disable indexing on your CD servers.-
Open the
<SITECORE_INSTANCE_ROOT>\Website\App_Config\Include\Coveo\SwitchMasterToWeb.Coveo.config.example
file. -
Add the following
<coveoOnPublishEndAsyncPub>
element as an immediate child of thecontentSearch/indexConfigurations/indexUpdateStrategies
element:<coveoOnPublishEndAsyncPub name="coveoOnPublishEndAsyncPub"> <param desc="database"> <patch:delete /> </param> <CheckForThreshold> <patch:delete /> </CheckForThreshold> </coveoOnPublishEndAsyncPub>
If you make changes to the
<coveoOnPublishEndAsyncPub>
element (i.e., to the element name or itsname
attribute value), ensure you match these changes in the child<strategy>
element of the<index>
element you added earlier.NoteThe
SwitchMasterToWeb.Coveo.config
file will be enabled on your CDs later in the scaling process.
-
-
Save your changes.
Step 2: Rebuild the Search Index for the Additional Database
Your additional database is now properly configured and can be indexed by Coveo for Sitecore. Use the Coveo Command Center Indexing Manager to rebuild the newly created index.
|
Your Sitecore items are indexed with clickable URI values matching a |
Step 3: Configure the UseHostHeaderForRequestURL
Setting
Under the hood, Coveo for Sitecore performs HTTP requests on its own.
To ensure that these internal HTTP requests are targeting the expected endpoint, the aspnet:UseHostHeaderForRequestUrl
setting must be set properly (see ASP.NET appSettings Element for details).
|
Note
The |
Follow these steps to configure the setting on the CM1
instance:
-
Open your
web.config
file. -
Inside
configuration
/appSettings
, add the following element:<add key="aspnet:UseHostHeaderForRequestUrl" value="true" />
-
Save and close the file.
Step 4: Configure the Farm Name on the Instance to Be Scaled
When scaling Sitecore instances, you need to set a Farm name
to ensure all the Sitecore instances share the same resources.
Setting a Farm name
affects the names of the sources, field sets, security provider, and user identities.
Instead of assigning them an individual name, you give them the same label.
Follow the Assign a Farm Name to Coveo for Sitecore Resources guide to configure the CM1
instance.
|
When choosing a |
What’s Next?
Now that you installed Coveo for Sitecore on your first content management instance, you may proceed either to:
-
Deploy Coveo for Sitecore on an additional content management instance (see Deploy on Additional Content Managers).
OR
-
Deploy Coveo for Sitecore on your content delivery server(s) (see Deploy Coveo for Sitecore on the Content Delivery Servers).