Mapping Rules Hierarchy

It is possible and recommended to have multiple mapping rules using different metadata to make sure your items are indexed with relevant values even if your preferred metadata could not be extracted.

  • Rules are applied sequentially from the top of the list until one of them succeeds (see Manage 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 V2 administration console, and will be applied starting from the top.

  • author: %[firstName] %[lastName]

    If the metadata lastName does not 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 do not 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.