Mapping Rules Hierarchy

We recommend that you have multiple mapping rules using different metadata to ensure your items are indexed with relevant values when your preferred metadata can’t be extracted.

When you do so, the following principles apply:

  • These rules are applied sequentially from the top of the list until one of them succeeds (see Adding and Managing Source Mappings and Mapping Rule Syntax Reference).

  • A rule is successful if at least one metadata is mapped correctly to an index field or if the rule contains text.

    Rules only containing text (no metadata names) are always successful.

  • Once a rule is successful, the other rules (if any) are ignored.

  • If no rule succeeds, the index field is left empty.

Here is a set of mapping rules applied to the author index field. These rules appear in the same order in the Coveo Cloud Administration Console, and will be applied starting from the top.

  • author: %[firstName] %[lastName]

    If the metadata lastName doesn’t exist but firstName does, the rule is successful, meaning the field author will contain the firstName metadata values. In such case, the following rules are ignored.

  • author: %[username]

    If both metadata in the first rule don’t exist, the string contained in username will fill the field.

  • author: Anonymous

    If none of the above metadata exist, then the string Anonymous will be the only value of the author field.

  • author: %[department]

    The rule will never apply in any circumstances since the third rule only contains text.

Recommended Articles