Skip to main content

Configure Content Tagging to include or exclude fields in the tagging process

Abstract

Configure Sitecore CortexTM Content Tagging to include or exclude fields based on field type or field name.

By default, the Sitecore CortexTM Content Tagging feature can process any content item in Sitecore. When it processes an item for tagging with the default configuration, it only includes the content of Multi-Line Text fields, Rich Text fields, and fields with the name Title. However, you can determine which fields are included in the tagging process. You can do this by changing the configuration file, or you can implement a custom content provider to determine which items and fields the Content Tagging feature processes.

This topic describes how to modify the \Website\App_Config\Sitecore\ContentTagging\Sitecore.ContentTagging.Core.config file to determine which fields are included in the tagging process.

Note

Remember to use a patch file to modify the config file so that your changes will not be overwritten if the config file is updated.

By default, the Sitecore.ContentTagging.Core.config file looks like this:

<fieldMap>
  <!--FieldTypes Specifies list of field types allowed to be used in tagging process.-->
  <fieldTypes>
    <fieldType fieldTypeName="Multi-Line Text"/>
    <fieldType fieldTypeName="Rich Text"/>
  </fieldTypes>
  <!--FieldNames Specifies list of field names allowed to be used in tagging process.-->
  <fieldNames>
    <field fieldName="Title"/>       
  </fieldNames>
</fieldMap>

To include the content of fields with a specific field type or field name in content tagging:

  • In the Sitecore.ContentTagging.Core.config file, add a fieldType node in the <fieldTypes> section or a field node in the <fieldNames> section.

    For example, if you want to tag the content of fields with the Number field type, and fields named Caption, then add new nodes as follows:

    <fieldMap>
      <!--FieldTypes Specifies list of field types allowed to be used in tagging process.-->
      <fieldTypes>
        <fieldType fieldTypeName="Multi-Line Text"/>
        <fieldType fieldTypeName="Rich Text"/>
        <fieldType fieldTypeName="Number"/>
      </fieldTypes>
      <!--FieldNames Specifies list of field names allowed to be used in tagging process.-->
      <fieldNames>
        <field fieldName="Title"/>
        <field fieldName="Caption"/>     
      </fieldNames>
    </fieldMap>

To exclude fields from the content tagging process:

  • In the Sitecore.ContentTagging.Core.config file, remove a fieldType node from the <fieldTypes> section or a field node from the <fieldNames> section.

    For example, no content will be tagged if the <fieldMap> section looks like this:

    <fieldMap>
      <!--FieldTypes Specifies list of field types allowed to be used in tagging process.-->
      <fieldTypes>
      </fieldTypes>
      <!--FieldNames Specifies list of field names allowed to be used in tagging process.-->
      <fieldNames>
      </fieldNames>
    </fieldMap>