Mapping Rule Syntax Reference

A mapping rule is a string used to instruct the indexing pipeline mapping stage to populate a given index field with a value (see Coveo Cloud V2 Indexing Pipeline). You define mapping rules when adding or editing a mapping in the Coveo Cloud administration console (see Edit the Mappings of a Source: [SourceName]).

AddMappingExample2

A mapping rule can consist of one or more metadata name placeholders in the following format: %[metadataName]. A placeholder is recognized and interpreted by the indexing pipeline mapping stage as a value to retrieve within the system metadata.

The Salesforce Knowledge metadata names for Knowledge specific fields are prefixed by Kav_.

For instance, to map the custom Details__c field, you would need to enter %[Kav_Details__c].

You can specify two arguments inside the tag: the name of the metadata to use and, optionally, the origin of the metadata. Specify the metadata origin using the following syntax: %[metadataName:origin].

You have a metadata named employeeID extracted in the indexing pipeline crawling stage and you want to populate the index field AuthorID, so you enter one of the following rules:

  • %[employeeID]

  • %[employeeID:crawler](when the metadata has multiple origins)

When your metadata includes a colon, you must be careful when formatting your rule because the keyword following the last colon is interpreted as the metadata origin. Therefore, if you wish to keep the colon in your metadata name, you must include an origin in the placeholder to disambiguate the rule format.

  • %[twitter:title] is interpreted as the metadata name and title as the metadata origin.

  • %[twitter:title:crawler] is interpreted as the metadata name and crawler as the metadata origin.

Mapping rules are not limited to a single metadata. You can create rules with multiple metadata names and mix the metadata names with text.

Miss %[firstName] %[lastName]

Item Title Selection

You can add or edit mapping rules to determine which metadata Coveo Cloud V2 should use as the item title. The default common mapping rule selects the title extracted during the crawling stage (%[title:crawler]) (see Coveo Cloud V2 Indexing Pipeline).

When you want to add or edit item title selection rules, the available options are the following:

  • %[detectedtitle:converter]

    Selects the title detected during the processing stage using text analysis.

    To establish the title, Coveo Cloud V2 uses key sentences and a list of concepts found to be the most important in the text of the item.

  • %[title:converter]

    Selects the title extracted from the binary item or the file system during the processing stage.

    • For a Microsoft Word item, the embedded title

    • For a web page, the value between the title tags (<title></title>)

    If the converter metadata is empty, Coveo Cloud V2 selects the title extracted during the crawling stage (%[title:crawler]).

  • %[title:crawler]

    Selects the title extracted during the crawling stage, which is usually the item filename.

    The subject of an email

  • %[title]

    Selects the title extracted during the processing stage (%[title:converter]).

    If the converter metadata is empty, Coveo Cloud V2 selects the title extracted during the crawling stage (%[title:crawler]).