Managing Fields for a Specific Index
Managing 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 |
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.
-
Open the
Coveo.SearchProvider.Custom.configfile with a text editor. -
Inside the
sitecorenode, add the code block below. Fields must be added in a<fieldNames hint="raw:AddFieldByFieldName">element. Replacemysitecorefieldwith the name of your Sitecore field. -
Add the
isSourceSpecificsetting and set the value totrue. This is required to create a unique name for this field (see Understanding Sitecore, Coveo for Sitecore, and Coveo Fields - Handling duplicate field names between indexes). -
Add the setting of your choice. In this example, the
isFacetsetting is set totrueto 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.