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
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.NoteThis processor is mandatory, as Coveo for Sitecore relies on the fields it defines.
-
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).NoteThis processor is mandatory, as Coveo for Sitecore relies on the fields it defines
-
The
AddAnalyticsFieldsProcessor
appends Sitecore fields related to experience profiles and personalization.NoteThis processor is mandatory if you’re using personalization features.
-
The
IncludeFieldsFromConfigOnlyProcessor
processor 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
AddExternalFieldsProcessor
appends the fields defined in theraw:AddExternalField
node. This processor is used to include fields coming from external Coveo sources (see About the Coveo Search Provider configuration file - externalFields). -
The
AddFieldMapFieldsProcessor
updates the parameters of the fields defined in theraw:AddFieldByFieldName
node (see About the Coveo Search Provider configuration file - FieldMap). -
The
ExcludeFieldsFromConfigProcessor
excludes all the fields that are defined in the<exclude hint="list:AddExcludedField">
element (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 |
|
AddAnalyticsFieldsProcessor |
|
AddComputedFieldsProcessor |
|
IncludeFieldsFromConfigOnlyProcessor |
|
AddExternalFieldsProcessor |
|
AddFieldMapFieldsProcessor |
|
ExcludeFieldsFromConfigProcessor |
|
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);
}
}