How to remove the fz95xcreator43506 and fz95xeditor43506 field from Coveo indexing?
We need to remove the Creator and Editor details from Coveo response for security exception. Is there any way to remove the fields from indexing?.
Excluding fields from a Coveo for Sitecore index is the same process as with Lucene or Solr. You have to add the field in the Sitecore configuration as explained in the documentation: Specify which Fields to Index
The configuration node you posted is just a factory. It requires to be referenced by the Coveo default index configuration to be used.
Do you have the following element in your Coveo default index configuration (`/coveo/defaultIndexConfiguration/documentOptions`)?
<exclude hint="list:AddExcludedField" ref="mandatory, do not delete" factory="excludedFieldsFactory" />
I just checked the Lucene default index configuration. While it contains fields to exclude elements named "Editor", the real Sitecore item names of these are either "Editor" or "__Editor" (With 2 leading underscore characters) while you are trying to remove a field named "_editor" (with a single leading underscore character as per the "z95x" in front of the Coveo field name you provided).
The Lucene default index configuration does not exclude a "_creator" field. It instead configures it:
<field fieldName="creator" storageType="YES" indexType="TOKENIZED" vectorType="NO" boost="1f" type="System.String" settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider">
I also cannot find the "editor" and "_creator" fields in the content tree. This means those fields are not in a template but are added programmatically by Sitecore on items. Because of that, we cannot exclude then using the
AddExcludedField configuration section.
If you want to remove those fields at indexing time, you have a few options:
- Write and add a processor for the
coveoIndexingGetFieldspipeline that would exclude those 2 fields. This is the pipeline that decides which fields will be created in the Coveo index. If your 2 fields are not created in the Coveo index in the first place, they will not be indexed for Sitecore items.
- Or write and add a processor for the
coveoPostItemProcessingPipelinepipeline that would remove those 2 Sitecore fields meta data from the
ICoveoIndexableobject. This pipeline offers you the possibility to modify the data sent to the Coveo index for an item. It runs after Coveo for Sitecore has read the Sitecore fields.
If you want to exclude the fields at query time (more costly because the processor is run more often), you can follow the documentation you already found. Note that you need your assembly and configuration on each of your Sitecore instances (CM, CD…)