About the Search Result Title Selection Sequence
About the Search Result Title Selection Sequence
The title of an item is the first thing you see in a search result. This article explains the default title selection sequence and how to customize the behavior to suit specific needs.
Item Title Information Collection Process
Coveo for Sitecore collects several pieces of information that can be used for the item title and sends this information as metadata to the Coveo Platform.
Then, in the Coveo indexing pipeline, a converter also extracts metadata from the item that can be used as the item title.
Collecting all this title metadata ensures each item has a metadata value to map to the title
Coveo field.
The following diagram summarizes the default title
metadata collection process of an HTML item and how the title
Coveo field value is determined.
Besides the way a value is assigned to the processing stage title metadata
, the process is the same for all types of Sitecore items.
This behavior yields adequate item titles most of the time. If it doesn’t in your use case, you can customize your result titles.
Customize Your Result Titles
What determines the metadata to be used for the title
Coveo field is the mapping rule configured for this field in your Coveo organization source.
Coveo for Sitecore configures sources with the default %[title]
mapping rule, but you can edit this mapping to suit your needs.
After editing the default For example, you edit the When multiple rules are defined, the first rule is applied when possible (in this example, |
You can change a mapping rule in two ways:
-
By changing the origin parameter in the rule to select the crawling stage metadata.
-
By changing the
metadata
to use (that is, using a different Sitecore template field).
Use the Crawling Stage Metadata for the Item Title
Coveo for Sitecore has a crawling stage title
metadata fallback selection process.
Coveo for Sitecore then sends the item to Coveo with its crawling stage title
metadata value.
In the case of HTML items, the processing stage title
metadata extracted from the HTML content will be considered over the crawling stage title
metadata.
You might want your item search result titles to be the ones Coveo for Sitecore sends as the crawling stage title
metadata values.
If so, you can edit the title
field mapping rule origin
parameter so that it uses the crawling stage title
metadata value.
To set the title
field mapping rule origin
parameter to crawler
-
On the Sources (platform-ca | platform-eu | platform-au) page, click the target source, and then click Mappings in the Action bar.
-
In the Edit mappings panel, click the title field, and then click Edit.
-
Change the existing rule to
%[title:crawler]
. -
Click Apply mapping, and then click Save.
-
In your Sitecore instance, reindex the items you want to apply the new mapping to.
You can now validate the titles by inspecting your source items in the Content Browser.
Use Another Metadata (for example, Name
, Display Name
) for the Item Title
Coveo for Sitecore automatically sends the Sitecore item Name
and Display name
to Coveo as the _name
and _displayname
metadata respectively.
You can use this metadata instead of the title
metadata for your item titles.
To use the _displayname
metadata in the title
field mapping rule
-
On the Sources (platform-ca | platform-eu | platform-au) page, click the source you want to target, and then click Mappings in the Action bar.
-
In the Edit mappings panel, click the title field, and then click Edit.
-
Change the existing rule to
%[_displayname]
. -
Click Apply mapping, and then click Save.
-
In your Sitecore instance, reindex the items you want to apply the new mapping to.
You can now validate the titles by inspecting your source items in the Content Browser.
Other Metadata You Can Use
You can use any included Sitecore template field as the metadata in your mapping rules, not only
Mapping rules aren’t limited to a single metadata.
You can create rules with multiple metadata names and even mix in some text (for example, |
Set the Title Metadata for a Specific Media Item Type
Mapping rules are usually applied to all source items. You can be more granular and apply a mapping rule only to items of a specific type.
Example:
You want to create a mapping rule so that all PDF items use the Display name
value as their title.
The Sitecore item |
-
On the Sources (platform-ca | platform-eu | platform-au) page, click the source you want to target, and then click Mappings in the Action bar.
-
In the Edit mappings panel, select the Specific tab.
-
In the upper-right corner, click Add > Item type.
-
In the Add an Item Type panel, click Select or create an item type, type
pdf
in the Filter field, and then select Enter.For help on determining the item type value to use for a given file type, see Find the Source Item Type Values.
-
Click Add type.
-
In the Edit mappings panel, click Add > Mapping in the upper-right corner.
-
Configure your mapping as follows:
Field:title
Apply to:Specific item types
>pdf
Rules:%[_displayname]
-
Click Apply mapping.
-
In the Edit mappings panel, click Save.
-
In your Sitecore instance, perform an indexing action on your media items.
You can now validate your media item titles by inspecting your source items in the Content Browser.