Exclude a field from the search results
Exclude a field from the search results
This article applies to indexing with the native connector included in the Coveo for Sitecore package.
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.configfile in a text editor. This file is typically located in<SITECORE_INSTANCE_ROOT>\App_Config\Include\Coveoor<SITECORE_INSTANCE_ROOT>\website\App_Config\Include\Coveo. -
In the
fieldMap/fieldNameselement, add the<fieldType>element below. Replacemysitecorefieldwith the Sitecore field name (not the Translated Name).<fieldType fieldName="mysitecorefield" isDisplayField="false" settingType="Coveo.Framework.Configuration.FieldConfiguration, Coveo.Framework" />NoteThe
fieldMap/fieldNameselement is located in thedefaultIndexConfigurationelement. Field settings defined in thedefaultIndexConfigurationelement are applied to all indexes that reference thedefaultIndexConfigurationelement. To apply field configurations on a specific index, see Manage fields for a specific index. -
Save your changes.
-
Note
Performing a POST request to
/coveo/api/index/v1/indexes/synchronizeisn’t enough for the change to be effective. A rebuild is required.
You can combine isDisplayField with the other settings presented in this section.