Manage Fields for a Specific Index

Instead of changing the setting of a field for all indexes, you can manage the setting of a field for a specific Coveo index.

Note

Field settings defined in the defaultIndexConfiguration element are applied to all indexes. However, you can override these settings at the index level (see Removing or Replacing Field Settings).

For example, to add a field configuration specifically for the Coveo_master_index index, you need to edit the Coveo Search Provider configuration as follows.

  1. Open your Coveo.SearchProvider.Custom.config file with a text editor.

  2. Inside your sitecore node, add the code below. Fields must be added in a <fieldNames hint="raw:AddFieldByFieldName"> element. Replace mysitecorefield with the name of your Sitecore field.

  3. Add the isSourceSpecific setting and set the value to true. This is required to create a unique name for this field (see Handling Duplicate Field Names Between Indexes).

  4. Add the setting of your choice. In this example, the isFacet setting is set to true to allow facet search on this field.

     <contentSearch>
       <configuration>
         <indexes>
           <index id="Coveo_master_index">
             <configuration ref="coveo/defaultIndexConfiguration">
               <fieldMap type="Coveo.SearchProvider.CoveoFieldMap, Coveo.SearchProvider">
                 <fieldNames hint="raw:AddFieldByFieldName">
                   <fieldType fieldName="mysitecorefield" isSourceSpecific="true" isFacet="true" settingType="Coveo.Framework.Configuration.FieldConfiguration, Coveo.Framework" />
                 </fieldNames>
               </fieldMap>
             </configuration>
           </index>
         </indexes>
       </configuration>
     </contentSearch>

Removing or Replacing Field Settings

Because all field settings defined in the defaultIndexConfiguration are applied to all Coveo indexes, remove and replace methods have been implemented to allow you to remove specific field settings or to replace the entire list of field settings for a specific Coveo index. The following are sections you may add in the Coveo.SearchProvider.Custom.config file and their usage.

  • indexes/index[id='<INDEX_NAME>']/configuration/fieldMap/fieldNames[hint='raw:RemoveFieldByFieldName']

    This section is used to remove Sitecore fields from the default list for a specific Coveo index.

  • indexes/index[id='<INDEX_NAME>']/configuration/fieldMap/fieldNames[hint='raw:ReplaceFieldByFieldName']

    This section is used to completely replace the Sitecore fields from the default list for a specific Coveo index.

  • indexes/index[id='<INDEX_NAME>']/configuration/fieldMap/externalFields[hint='raw:RemoveExternalField']

    This section is used to remove external fields from the default list for a specific Coveo index.

  • indexes/index[id='<INDEX_NAME>']/configuration/fieldMap/externalFields[hint='raw:ReplaceExternalField']

    This section is used to completely replace the external fields from the default list for a specific Coveo index.

  • indexes/index[id='<INDEX_NAME>']/configuration/fields[hint='raw:RemoveComputedIndexField']

    This section is used to remove computed fields from the default list for a specific Coveo index.

  • indexes/index[id='<INDEX_NAME>']/configuration/fields[hint='raw:ReplaceComputedIndexField']

    This section is used to completely replace the computed fields from the default list for a specific Coveo index.