Including Fields Using the Indexing Manager
Including Fields Using the Indexing Manager
Coveo for Sitecore 4.1 (October 2018)
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.config
patch file. -
If you had already included fields in the
Coveo.SearchProvider.Custom.config
by 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.config
patch file. -
All fields with names matching the one(s) selected in the Indexing Manager are added in the
<include>
element of the newCoveo.SearchProvider.Fields.Custom.config
file.
Coveo for Sitecore applies the coveoIndexingGetFields
pipeline 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 the coveoIndexingGetFields
pipeline.
However, once you use the Indexing Manager to include or exclude fields, the coveoIndexingGetFields
pipeline is condensed (see obsolete Default Processing Sequence Diagram versus the new Default Processing Sequence Diagram). Furthermore, since fields will necessarily be added through the IncludeFieldsFromConfigOnlyProcessor
processor going forward, the coveoIndexingGetFields
pipeline is, in effect, truncated after the IncludeFieldsFromConfigOnlyProcessor
processor.
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
productname
field and other fields in theCoveo.SearchProvider.Custom.config
by defining them in the<include hint="list:IncludeField">
or the<include hint="list:AddIncludedField">
element. You now remove a field calledproductname
using 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.config
file are added to the<include>
element of the newCoveo.SearchProvider.Fields.Custom.config
patch file in order to carry over your current field inclusion configuration. -
The
productname
field is removed from the<include>
element of theCoveo.SearchProvider.Fields.Custom.config
patch file.
The result in this scenario is a
Coveo.SearchProvider.Fields.Custom.config
file with fields in the<include>
element, but not theproductname
field. As the last patch file to load<include>
fields isCoveo.SearchProvider.Fields.Custom.config
, theproductname
field 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 fieldproductname
using the Indexing Manager.Coveo for Sitecore handles the situation as follows:
-
Fields included through downstream processors (for example, the
AddTemplateFieldsProcessor
processor) are added to the<include>
element of the newCoveo.SearchProvider.Fields.Custom.config
patch file in order to carry over your current field inclusion configuration. -
If the
productname
field was added to the<include>
element of the newCoveo.SearchProvider.Fields.Custom.config
patch file as part of step 1, it’s now removed from it.
The result in this scenario is a
Coveo.SearchProvider.Fields.Custom.config
that contains fields in its<include>
element, but not theproductname
field. Theproductname
field 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.config
file which is the final patch file for<include>
elements -
truncating the
coveoIndexingGetFields
pipeline after theIncludeFieldsFromConfigOnlyProcessor
processor (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.