Excluding a Field From the Search Results
Excluding 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 index doesn’t include this field in the response to Coveo-powered search interface requests.
-
Open the
Coveo.SearchProvider.Custom.config
file in a text editor. -
In the
fieldMap/fieldNames
element, add a new element, like the one below, with itsisDisplayField
attribute set tofalse
. You must replacemysitecorefield
with the name of the Sitecore field.<fieldType fieldName="mysitecorefield" isDisplayField="false" settingType="Coveo.Framework.Configuration.FieldConfiguration, Coveo.Framework" />
The
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 Managing Fields for a Specific Index. -
Save your changes.
-
Synchronize these field settings changes into your search indexes by performing an indexing action. Alternatively, perform a manual synchronization of your configuration (see Synchronize Coveo for Sitecore Configuration). The indexes will no longer include the field in search results back to the search interface(s).
You can also combine isDisplayField
with the other settings presented in this section.