About the coveoIndexingGetFields Pipeline

This article explains how Coveo determines which fields should be indexed and how it leverages the coveoIndexingGetFields pipeline.

Default Processing Sequence Diagram

The diagram below shows the default sequence in which the processors are invoked.

All processors are interchangeable. For the assembly-qualified type name of each processor, see Processors Assembly-Qualified Type Names.

Coveo Indexing Get Fields
  1. The AddSpecialFieldsProcessor processor retrieves some built-in Sitecore fields such as _id, _name, _templatename, and so on. These fields are used by the Coveo filtering rules.

    This processor is mandatory, as Coveo for Sitecore relies on the fields it defines.

  2. The AddComputedFieldsProcessor processor retrieves the computed fields that are defined in the <fields hint="raw:AddComputedIndexField"> element. By default, this list contains a series of computed fields used by the Coveo filtering rules. You can also create your own computed fields (see Create Computed Fields).

    This processor is mandatory, as Coveo for Sitecore relies on the fields it defines

  3. The AddAnalyticsFieldsProcessor appends Sitecore fields related to experience profiles and personalization.

    This processor is mandatory if you’re using Coveo for Sitecore personalization features (see Leverage Sitecore Experience Database (xDB) in Coveo for Sitecore).

  4. The IncludeFieldsFromConfigOnlyProcessor processor retrieves the fields that are defined in the <include hint="list:IncludeField"> element for Sitecore versions prior to 8.1, and <include hint="list:AddIncludedField"> for Sitecore versions 8.1+. When at least one field is marked as included, the field is added to the list of fields to index, and then the pipeline is aborted. In other words, no more processors are invoked (see Including or Excluding Fields from the Indexing).

  5. The AddExternalFieldsProcessor appends the fields defined in the raw:AddExternalField node. This processor is used to include fields coming from external Coveo sources (see About the Coveo Search Provider Configuration File - externalFields).

  6. The AddFieldMapFieldsProcessor updates the parameters of the fields defined in the raw:AddFieldByFieldName node (see About the Coveo Search Provider Configuration File - FieldMap).

  7. The ExcludeFieldsFromConfigProcessor excludes all the fields that are defined in the <exclude hint="list:ExcludeField"> element for Sitecore versions prior to 8.1, and <exclude hint="list:AddExcludedField"> for Sitecore versions 8.1+ (see Including or Excluding Fields from the Indexing).

The processors can be reordered according to your specific needs. You can also add your own custom processors.

Processors Assembly-Qualified Type Names

Processor name Assembly-qualified type name

AddSpecialFieldsProcessor

Coveo.AbstractLayer.Processors.Indexing.Fields.AddSpecialFieldsProcessor, Coveo.AbstractLayer

AddAnalyticsFieldsProcessor

Coveo.AbstractLayer.Processors.Indexing.Fields.AddAnalyticsFieldsProcessor, Coveo.AbstractLayer

AddComputedFieldsProcessor

Coveo.AbstractLayer.Processors.Indexing.Fields.AddComputedFieldsProcessor, Coveo.AbstractLayer

IncludeFieldsFromConfigOnlyProcessor

Coveo.AbstractLayer.Processors.Indexing.Fields.IncludeFieldsFromConfigOnlyProcessor, Coveo.AbstractLayer

AddExternalFieldsProcessor

Coveo.AbstractLayer.Processors.Indexing.Fields.AddExternalFieldsProcessor, Coveo.AbstractLayer

AddFieldMapFieldsProcessor

Coveo.AbstractLayer.Processors.Indexing.Fields.AddFieldMapFieldsProcessor, Coveo.AbstractLayer

ExcludeFieldsFromConfigProcessor

Coveo.AbstractLayer.Processors.Indexing.Fields.ExcludeFieldsFromConfigProcessor, Coveo.AbstractLayer

Creating a Custom Processor for the coveoIndexingGetFields Pipeline

To compile the class, you need to reference the following assemblies:

  • Coveo.AbstractLayer

  • Coveo.Framework

  • Sitecore.Kernel

This sample code adds the field myFieldName to the list of indexed fields. The field then appears in the search index field set.

public class AddCustomField : Coveo.Framework.Processor.IProcessor<Coveo.AbstractLayer.Pipeline.CoveoIndexingGetFieldsArgs>
{
    public void Process(CoveoIndexingGetFieldsArgs p_Args)
    {
        // The fields are stored in the "Fields" property and can be added or removed.
        // A field can be added by passing its Sitecore name and type.
        Coveo.AbstractLayer.FieldManagement.FieldInformation newField
            = new Coveo.AbstractLayer.FieldManagement.FieldInformation("myFieldName", "Single-Line Text");
        p_Args.Fields.Add(newField);
    }
}
What's Next for Me?