Coveo for Sitecore 5 is now available!

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 is 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:

  1. Coveo for Sitecore generates the new Coveo.SearchProvider.Fields.Custom.config patch file.
  2. 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 new Coveo.SearchProvider.Fields.Custom.config patch file.
  3. All fields with names matching the one(s) selected in the Indexing Manager are added in the <include> element of the new Coveo.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 does not 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 are 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 the Coveo.SearchProvider.Custom.config by defining them in the <include hint="list:IncludeField"> or the <include hint="list:AddIncludedField"> element. You now remove a field called productname using the Indexing Manager.

    Coveo for Sitecore handles the situation as follows:

    1. The fields defined in the <include hint="list:IncludeField"> or the <include hint="list:AddIncludedField"> element of the Coveo.SearchProvider.Custom.config file are added to the <include> element of the new Coveo.SearchProvider.Fields.Custom.config patch file in order to carry over your current field inclusion configuration.
    2. The productname field is removed from the <include> element of the Coveo.SearchProvider.Fields.Custom.config patch file.

    The end result in this scenario is a Coveo.SearchProvider.Fields.Custom.config file with fields in the <include> element, but not the productname field. As the last patch file to load <include> fields is Coveo.SearchProvider.Fields.Custom.config, the productname 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 field productname using the Indexing Manager.

    Coveo for Sitecore handles the situation as follows:

    1. Fields included through downstream processors (e.g., the AddTemplateFieldsProcessor processor) are added to the <include> element of the new Coveo.SearchProvider.Fields.Custom.config patch file in order to carry over your current field inclusion configuration.
    2. If the productname field was added to the <include> element of the new Coveo.SearchProvider.Fields.Custom.config patch file as part of step 1, it is now removed from it.

    The end result in this scenario is a Coveo.SearchProvider.Fields.Custom.config that contains fields in its <include> element, but not the productname field. The productname 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 are 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 the IncludeFieldsFromConfigOnlyProcessor 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.