In Azure Search Index configuration, there is an option to include Fields that need to be indexed. But the catalog generated Templates Field may be having different id's in different environments (Dev,QA,Prod). So how can we include these fields in Azure search index configuration
1 Answer
Commerce uses a separate crawler to index Commerce items. The default crawlers do not index Commerce items and skip them.
<indexing.getChildrenToIndex> is responsible for skipping Commerce items.
Field IDs will be different on different environments.
If you need to extend the base templates with your custom templates, you can take a look into TemplateGeneratorConfiguration
. It's possible to extend commerce templates by providing list of custom base templates:
<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/">
<sitecore role:require="Standalone or ContentDelivery or ContentManagement">
<commerceEngineTemplateGenerator
type="Sitecore.Commerce.Engine.Connect.DataProvider.Configuration.TemplateGeneratorConfiguration, Sitecore.Commerce.Engine.Connect">
<baseTemplates hint="raw:AddBaseTemplates">
<!-- Category -->
<template id="{4C4FD207-A9F7-443D-B32A-50AA33523661}">
<baseTemplate>{E94D0466-BC9A-47AA-B0B0-1D626B10BFD6}</baseTemplate>
</template>
<!-- Commerce Product Template -->
<template id="{225F8638-2611-4841-9B89-19A5440A1DA1}">
<baseTemplate>{E94D0466-BC9A-47AA-B0B0-1D626B10BFD6}</baseTemplate>
</template>
<!-- Commerce Bundle Template -->
<template id="{61F5CE3E-E550-4CED-8983-20242893A459}">
<baseTemplate>{E94D0466-BC9A-47AA-B0B0-1D626B10BFD6}</baseTemplate>
</template>
</baseTemplates>
</commerceEngineTemplateGenerator>
</sitecore>
</configuration>
The configuration is located here:
App_Config\Include\Z.Commerce.Engine\Sitecore.Commerce.XA.TemplateGeneration.config
You can patch easily patch it.