About the coveoIndexingGetFields pipeline
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.
-
The
AddSpecialFieldsProcessorprocessor retrieves some built-in Sitecore fields such as_id,_name,_templatename, and so on. These fields are used by the Coveo filtering rules.NoteThis processor is mandatory, as Coveo for Sitecore relies on the fields it defines.
-
The
AddComputedFieldsProcessorprocessor 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.NoteThis processor is mandatory, as Coveo for Sitecore relies on the fields it defines
-
The
AddAnalyticsFieldsProcessorappends Sitecore fields related to experience profiles and personalization.NoteThis processor is mandatory if you’re using personalization features.
-
The
IncludeFieldsFromConfigOnlyProcessorprocessor retrieves the fields that are defined in the<include hint="list:AddIncludedField">element. 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). -
The
AddExternalFieldsProcessorappends the fields defined in theraw:AddExternalFieldnode. This processor is used to include fields coming from external Coveo sources (see About the Coveo Search Provider configuration file - externalFields). -
The
AddFieldMapFieldsProcessorupdates the parameters of the fields defined in theraw:AddFieldByFieldNamenode (see About the Coveo Search Provider configuration file - FieldMap). -
The
ExcludeFieldsFromConfigProcessorexcludes all the fields that are defined in the<exclude hint="list:AddExcludedField">element.Leading practiceThis processor is slow when many fields are configured in your Sitecore setup. If you’re currently using this processor to exclude fields from being indexed, switch to the field inclusion approach for better performance.
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 |
|
AddAnalyticsFieldsProcessor |
|
AddComputedFieldsProcessor |
|
IncludeFieldsFromConfigOnlyProcessor |
|
AddExternalFieldsProcessor |
|
AddFieldMapFieldsProcessor |
|
ExcludeFieldsFromConfigProcessor |
|
Creating a custom processor for the coveoIndexingGetFields pipeline
To compile the class, 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);
}
}