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.
Field settings defined in the defaultIndexConfiguration
element are applied to all indexes. See Removing or Replacing Fields to remove a field setting previously configured in all indexes.
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.config
file with a text editor. - Inside the
sitecore
node, add the code block below. Fields must be added in a<fieldNames hint="raw:AddFieldByFieldName">
element. Replacemysitecorefield
with the name of your Sitecore field. - Add the
isSourceSpecific
setting 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
isFacet
setting is set totrue
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
Coveo for Sitecore (July 2016)
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.