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 Cloud 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

  1. Open the Coveo.SearchProvider.Custom.config file in a text editor.
  2. In the fieldMap/fieldNames element, add a new element, like the one below, with its isDisplayField attribute set to false. You must replace mysitecorefield 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 the defaultIndexConfiguration element. Field settings defined in the defaultIndexConfiguration element are applied to all indexes that reference the defaultIndexConfiguration element. To apply field configurations on a specific index, see Manage Fields for a Specific Index.

  3. Save your changes.

  4. Rebuild your indexes.

    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.

Recommended Articles