Manage Source Mappings

Members of the Administrators and Content Managers built-in groups can add and edit mappings.

mappings define what Coveo index fields contain for each source item. This information typically comes from item metadata, but can also be a specific value for all source items.

A Coveo source needs mapping instructions to associate the repository metadata values with appropriate index fields (see About Fields).

Feature Push source All other source types

Default mappings

x

check

Automatically created mappings

When matching metadata[1] and Coveo index field names


1. Metadata names are case sensitive.

x

Manually created mappings

  • When metadata names and destination field names are different

  • When the same value must be set for all source items

Notes

Access the "Edit the Mappings of a Source" Panel

  1. Log in to Coveo (platform-eu | platform-au) as a member of a group with the required privileges to manage sources in the target Coveo organization, if not already done.

  2. In the main menu on the left, under Content, select Sources.

  3. On the Sources (platform-eu | platform-au) page, click the source for which you want to manage mappings, and then click More > Manage mappings in the Action bar.

  4. In the Edit the Mappings of a Source panel, the Common tab is shown by default. Other tabs are Specific and JSON.

"Common" Tab

The Common tab displays mappings that apply to all source item types.

The information you can review in this tab is the following:

"Specific" Tab

The Specific tab displays mappings that only apply to certain source item types.

The information you can review in this tab is the following:

"JSON" Tab

The JSON tab shows the source mapping rules in JSON format. Any modification made in the Common and Specific tabs automatically updates the JSON accordingly, and vice versa. You can review this raw source configuration for troubleshooting purposes, but you can also modify the configuration itself.

The content displayed in the JSON tab is similar to that in the Mappings tab of the Edit a Source JSON Configuration panel (see Edit a Source JSON Configuration). Therefore, the following instructions apply to both panels:

Access the "JSON" Tab

  1. On the Sources (platform-eu | platform-au) page, click the source for which you want to manage mappings, and then click More > Manage mappings in the Action bar.

  2. In the Edit the Mappings of a Source panel, select the JSON tab.

Manage Mappings

Add an Item Type

Adding an item type allows you to apply a mapping rule only to items of this specific type, rather than to all source item types (see Source Item Types).

  1. In the Edit the Mappings of a Source panel, click the Add drop-down menu, and then select Item type.

  2. In the Add an Item Type dialog, click the drop-down menu and select or create an item type, and then click Add Type (see Source Item Types).

  3. In the Edit the Mappings of a Source panel:

    • If you’re done managing items or mapping rules, click Save and Rebuild (see Add or Edit a Mapping Rule or Edit an Item Type Name).

      OR

    • If you want to add or edit other items or mapping rules, click Save.

      Notes
      • Clicking Save defers the source rebuild operation, which is necessary to apply changes. Since a source with several millions of items may take weeks to rebuild, choosing the Save option when possible prevents stressing the Coveo and system server resources. It’s therefore recommended to click Save when you plan on making additional changes in the short term, and then to click Save and Rebuild once you’re ready to update your source.

      • item types with no associated mapping rules are deleted when you save your changes.

  4. If you clicked Save, back on the Sources (platform-eu | platform-au) page, under the source Status column, click Launch rebuild when you’re ready or wait for the next scheduled source rebuild to make the changes effective.

Add or Edit a Mapping Rule

The following procedure lets you apply a mapping rule to your source or edit an existing mapping rule.

  1. Access the mapping addition/editing dialog:

    • To add a mapping rule: in the Edit the Mappings of a Source panel, click the Add drop-down menu, and then select Mapping.

      OR

    • To edit a mapping rule, in the Edit the Mappings of a Source panel:

      1. Access the "Common" tab or the "Specific" tab.

      2. In the Common or Specific tab, click the desired mapping rule, and then click Edit in the Action bar.

  2. In the mapping addition/editing dialog:

    1. Under Field, select the field to which the mapping rule should apply:

      • Click the drop-down menu and select the desired field to which the mapping rule should apply. You can also start typing the desired field name to filter your options.

        Note

        You can edit most of the fields in the list by clicking Edit Field.

        OR

      • Click Add Field to add a new field.

    2. Under Apply to, click All items (common) or Specific item types to determine to which items the mapping rule should apply.

    3. (If you selected Specific item types) Select the item types to which the mapping should apply. You can also add missing item types.

    4. Under Rules, enter the mapping rule to apply to the selected items.

    5. Click Apply if you’re adding a mapping rule, and Save if you’re editing a mapping rule.

  3. In the Edit the Mappings of a Source panel:

    • If you’re done adding and editing mapping rules, click Save and Rebuild.

      OR

    • If you want to add or edit other mapping rules, click Save.

      Note

      Clicking Save defers the source rebuild operation, which is necessary to apply changes. Since a source with several millions of items may take weeks to rebuild, choosing the Save option when possible prevents stressing the Coveo and system server resources. It’s therefore recommended to click Save when you plan on making additional changes in the short term, and then to click Save and Rebuild once you’re ready to update your source.

  4. If you clicked Save, back on the Sources (platform-eu | platform-au) page, under the source Status column, click Launch rebuild when you’re ready or wait for the next scheduled source rebuild to make the changes effective.

Mapping Rule Evaluation

You may add more than one rule on the same field as a fallback, to make sure that your items are indexed with a value.

Coveo evaluates the rules in the order they appear. If the first rule is resolved with a result that’s not empty, Coveo saves this result in the desired field. Conversely, if no value is extracted, Coveo evaluates the next rule, and so on.

If none of the rules produce a non-empty value, the field value is considered empty and doesn’t appear in the item metadata.

Example

You add the following mapping rules to the field author:

  • %[fullname]

  • %[firstName] %[lastName]

  • Anonymous

If the metadata fullname doesn’t exist on a given item, Coveo gets an empty value when evaluating the first rule. Therefore, it considers the second rule. If firstName and/or lastName are non-empty, Coveo indexes the resulting value. Conversely, if the second rule yields no result, Coveo evaluates the third rule, which is a plain string, as a last resort. This rule produces the string "Anonymous", which Coveo indexes. In Coveo’s index, the item metadata therefore contains: author: Anonymous.

Edit an Item Type Name

  1. In the Edit the Mappings of a Source panel, access the "Specific" tab.

  2. In the Specific tab, click the desired item type, and then click Edit in the Action bar.

  3. In the Edit an Item Type dialog, edit the item type name, and then click Save.

  4. Back in the Edit the Mappings of a Source panel:

    • If you’re done adding and editing items and mapping rules, click Save and Rebuild.

      OR

    • If you want to add or edit other items and mapping rules, click Save.

      Note

      Clicking Save defers the source rebuild operation, which is necessary to apply changes. Since a source with several millions of items may take weeks to rebuild, choosing the Save option when possible prevents stressing the Coveo and system server resources. It’s therefore recommended to click Save when you plan on making additional changes in the short term, and then to click Save and Rebuild once you’re ready to update your source.

  5. If you clicked Save, back on the Sources (platform-eu | platform-au) page, under the source Status column, click Launch rebuild when you’re ready or wait for the next scheduled source rebuild to make the changes effective.

Rebuild Source to Take Account of Mapping Rule Changes

Once you’re done adding or editing mapping rules, in the Edit the Mappings of a Source panel, click Save and Rebuild to apply your changes.

What’s Next?

Ensure that your mapping works as expected in the Content Browser (see Fields Tab).

What's next for me?