Exclude a field from the search results
Exclude a field from the search results
By default, every indexed field is returned in the search results when a query is executed. However, it’s possible to configure a field so that the Coveo index doesn’t include this field in the response to Coveo-powered search interface requests.
To configure a Sitecore field so that it’s excluded from results
-
Open the
Coveo.SearchProvider.Custom.config
file in a text editor. This file is typically located in<SITECORE_INSTANCE_ROOT>\App_Config\Include\Coveo
or<SITECORE_INSTANCE_ROOT>\website\App_Config\Include\Coveo
. -
In the
fieldMap/fieldNames
element, add the<fieldType>
element below. You must replacemysitecorefield
with the Sitecore field name (not the Translated Name).<fieldType fieldName="mysitecorefield" isDisplayField="false" settingType="Coveo.Framework.Configuration.FieldConfiguration, Coveo.Framework" />
NoteThe
fieldMap/fieldNames
element is located in thedefaultIndexConfiguration
element. Field settings defined in thedefaultIndexConfiguration
element are applied to all indexes that reference thedefaultIndexConfiguration
element. To apply field configurations on a specific index, see Manage fields for a specific index. -
Save your changes.
-
Note
Performing a POST call to
/coveo/api/index/v1/indexes/synchronize
isn’t enough for the change to be effective. A rebuild is required.
You can combine isDisplayField
with the other settings presented in this section.