Including Fields Using the Indexing Manager
Including Fields Using the Indexing Manager
Being able to select fields directly in the Coveo for Sitecore Indexing Manager greatly simplifies the process of adding fields to the <include> list.
However, it’s important to understand what happens behind the scenes when you add or remove fields using the Indexing Manager, especially if you have already used the Coveo.SearchProvider.Custom.config file for the same purpose.
This article explains how your current field inclusion configuration, driven by the coveoIndexingGetFields pipeline, is taken into account when you transition to using the Indexing Manager to specify the fields that should be indexed.
What Happens If I Add a Field the First Time I Use the Indexing Manager
If you add one or several fields the first time you use the Indexing Manager, Coveo for Sitecore handles the situation as follows:
-
Coveo for Sitecore generates the new
Coveo.SearchProvider.Fields.Custom.configpatch file. -
If you had already included fields in the
Coveo.SearchProvider.Custom.configby defining them in the<include hint="list:IncludeField">element (for Sitecore versions prior to 8.1) or the<include hint="list:AddIncludedField">(for Sitecore versions 8.1+), these fields are also carried over to the<include>element of the newCoveo.SearchProvider.Fields.Custom.configpatch file. -
All fields with names matching the ones selected in the Indexing Manager are added in the
<include>element of the newCoveo.SearchProvider.Fields.Custom.configfile.Coveo for Sitecore applies the
coveoIndexingGetFieldspipeline to determine which fields should ultimately be indexed. Adding the ability to include or exclude fields using the Indexing Manager doesn’t change this behavior. After you begin using the Indexing Manager to include or exclude fields to index, Coveo for Sitecore continues to invoke processors based on the sequence they’re specified in thecoveoIndexingGetFieldspipeline.However, once you use the Indexing Manager to include or exclude fields, the
coveoIndexingGetFieldspipeline is condensed (see obsolete Default Processing Sequence Diagram versus the new Default Processing Sequence Diagram). Furthermore, since fields will necessarily be added through theIncludeFieldsFromConfigOnlyProcessorprocessor going forward, thecoveoIndexingGetFieldspipeline is, in effect, truncated after theIncludeFieldsFromConfigOnlyProcessorprocessor.
What Happens If I Remove a Field the First Time I Use the Indexing Manager
If you remove one or several fields the first time you use the Indexing Manager, Coveo for Sitecore generates the new Coveo.SearchProvider.Fields.Custom.config patch file and adds fields in its <include> element, like in the case described in the previous section (see What Happens If I Add a Field the First Time I Use the Indexing Manager).
-
You had included the
productnamefield and other fields in theCoveo.SearchProvider.Custom.configby defining them in the<include hint="list:IncludeField">or the<include hint="list:AddIncludedField">element. You now remove a field calledproductnameusing the Indexing Manager.Coveo for Sitecore handles the situation as follows:
-
The fields defined in the
<include hint="list:IncludeField">or the<include hint="list:AddIncludedField">element of theCoveo.SearchProvider.Custom.configfile are added to the<include>element of the newCoveo.SearchProvider.Fields.Custom.configpatch file in order to carry over your current field inclusion configuration. -
The
productnamefield is removed from the<include>element of theCoveo.SearchProvider.Fields.Custom.configpatch file.The result in this scenario is a
Coveo.SearchProvider.Fields.Custom.configfile with fields in the<include>element, but not theproductnamefield. As the last patch file to load<include>fields isCoveo.SearchProvider.Fields.Custom.config, theproductnamefield is no longer indexed.-
In the
Coveo.SearchProvider.Custom.config, you had not included fields, neither in the<include hint="list:IncludeField">nor the<include hint="list:AddIncludedField">element. You now remove fieldproductnameusing the Indexing Manager.Coveo for Sitecore handles the situation as follows:
-
-
Fields included through downstream processors (for example, the
AddTemplateFieldsProcessorprocessor) are added to the<include>element of the newCoveo.SearchProvider.Fields.Custom.configpatch file in order to carry over your current field inclusion configuration. -
If the
productnamefield was added to the<include>element of the newCoveo.SearchProvider.Fields.Custom.configpatch file as part of step 1, it’s now removed from it.The result in this scenario is a
Coveo.SearchProvider.Fields.Custom.configthat contains fields in its<include>element, but not theproductnamefield. Theproductnamefield is no longer indexed.
Including or Excluding Fields Going Forward
When you use the Indexing Manager to include or exclude fields for the first time, you’re in essence doing the following:
-
building upon your current configuration
-
merging configurations in the new
Coveo.SearchProvider.Fields.Custom.configfile which is the final patch file for<include>elements -
truncating the
coveoIndexingGetFieldspipeline after theIncludeFieldsFromConfigOnlyProcessorprocessor (see Default Processing Sequence Diagram).
Consequently, you should no longer go back to editing field inclusion configurations through processors that are downstream from the IncludeFieldsFromConfigOnlyProcessor processor, nor should you continue to edit the Coveo.SearchProvider.Custom.config file for field inclusion or exclusion purposes.
The Indexing Manager is the recommended method going forward.