- About Sitecore, Coveo for Sitecore, and Coveo Fields
- Special Character Translation in Field Names
- About the Search Result Title Selection Sequence
- Understanding How Coveo for Sitecore Resolves the Site for the Clickable URI
- Specify Which Fields to Index
- Change the Settings of Sitecore Fields
- Create Computed Fields
About the Search Result Title Selection Sequence
The title of an item is the first thing you see in the search results and this field has to contain something. Coveo for Sitecore determines the search result title of an item using the following sequence:
The title extracted from metadata detected by the Coveo index converters:
If the page item content is extracted through an HTTP request, Coveo uses the
<title>element text content.
If the item is a media item, Coveo uses the
The Sitecore item
Titlefield value, provided you’re indexing this field (see About the Indexing Manager - Fields).
The Sitecore item
Display Nameproperty value.
The Sitecore item
With Sitecore content items, Coveo for Sitecore works its way down in this selection sequence until it encounters a valid value. While this is technically a desirable behavior, you may need to force the choice of one or another of these values in your own installation. In such cases, a developer or an administrator needs to modify the configuration files.
With Sitecore media items, you can also force the title of the item to be a value other than the
This can be achieved by creating a mapping in your Coveo organization.
Change the Title of Content Items
The way to change the title of content items is to prevent Coveo for Sitecore from setting the title at one or multiple steps of the sequence.
As the indexing process progresses, the title of an item changes.
Before indexing, the
Display Name or
Name properties are used.
Then, at indexing time, if a Sitecore item has a field called
Title, it will automatically be mapped to the Coveo field
Finally, when the item goes through the index converter, if there’s an extracted
title metadata, it’s set as the new title.
The sections below explain how to bypass steps in the sequence.
Ignore the HTML Title Metadata (1st level)
You can deactivate these processors and use the BasicHtmlContentInBodyProcessor Processor which doesn’t send an HTTP request.
Alternatively, you can exclude the
<title> element from the response using the
CleanHTML sub-processor with the
FetchPageContent Processor (see Index Page Content With the FetchPageContentProcessor - The postProcessing Section).
HTMLContentInBodyWithRequestsProcessor processor also provides an equivalent feature (see Index With the HTMLContentInBodyWithRequestsProcessor - Option 1: Using HTML comments).
As with any major change, don’t forget to rebuild your indexes (see Coveo for Sitecore Indexing Guide).
If you don’t rebuild your indexes, your modifications will be applied to new items only.
Ignore the Title Field (2nd level)
For any Sitecore item, the title Coveo index field is automatically mapped to the title Sitecore field if it exists, as it usually does. This is a default Coveo indexing behavior: if a Coveo index field matches an item field name, they’re mapped together. Therefore, the only way to bypass this is to rename the field in Sitecore so the field names don’t match anymore.
Your website pages usually have several titles which can be used in different contexts.
You could have a
long title and a
short title field so you can use one or the other depending on the actual room you have to display it.
In your Sitecore instance, open the Content Editor.
In the navigation tree, navigate to the template you want to edit, and click it.
In the right pane, in the Builder tab, locate the
Titlefield and modify its name.
In the ribbon, click Save.
Repeat the procedure for every item template for which you want to bypass the title mapping.
Rebuild your indexes (see Coveo for Sitecore Indexing Guide).
Display Name (3rd and 4th level)
Name property contains the actual name of the item within Sitecore while
Display Name is the one used in the Sitecore Content Editor so item names are more readable.
Basically, if there’s a
Display Name, it will be used and if there isn’t, Coveo for Sitecore will fall back on the name of the item.
If you want the latter to be chosen, remove the
See How to set Display Name for more information.
Change the Title of Media Items
You can change the value that a media item uses as its title in Coveo search results by mapping the item
title field to a different property value.
For example, you can create a mapping so that all PDF items appear with the
Display Name value as their title in search results when a
Display Name is set on the Sitecore media item.
The Sitecore item
To create a mapping specifically for PDF items in a source so that the Sitecore item
Display Name is used as the indexed item title
Open the Sources page in the Coveo Administration Console.
Select the source you want to create the mapping for, and select More > Manage Mappings.
In the Edit the Mappings of a Source panel, select the Specific tab.
Select Add > Item Type in the upper-right corner of the panel.
In the Add an Item Type panel, type
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 the Mappings of a Source panel, select Add > Mapping in the upper-right corner.
Configure your mapping as follows.
Specific item types>
See Mapping Rule Syntax for more rule examples.
Click Apply Mapping.
In the Edit the Mappings of a Source panel, click Save.
In your Sitecore instance, perform an indexing action on your media items.
If you now open your source in the Content Browser, your PDF media items should show the
Display Name as their title, for all items where a
Display Name has been specified.