Standard Mapping File Schema
Notes:
-
CES 7.0.7914+ (October 2015) Using a mapping file, in a field or body element, you can retrieve the content of an external file by setting the isUrl attribute to true in the start tag and entering the external file URL as the value.
Example: <Field name="contact" isUrl="true">%[UrlMetadata]</field>
The normal mapping resolution is performed and when the download attempt of the resolved value is successful, the downloaded content is converted to a string and put in the body or field element. One use case is when you have a database with a column containing a URI that points to a document that you want to use as a body.
When using this feature, have in mind that:
-
isUrl is case-sensitive.
-
Direct mapping (ex: <Field name="[value]" isUrl="true">[value]</Field>) and mapping resolution (ex: <Body isUrl="true">%[File_Path_or_URL]</Body>) are both supported schemes.
-
Old mappings are compatible, meaning that when isUrl is not specified, the attribute is considered set to false (no download is performed).
-
The specified external file can be a .PDF, .DOCS, .ETC, .TXT, . RTF or .HTML file and its URL can start with http://, https:// or file://.
-
The content of the external file must be public since no authentication is supported when performing the download attempt.
-
When an invalid URL is specified, an error message stating that a mapping fails is logged, but the document is still indexed.
-
-
By default, when the name of a field in the field set selected for the source matches the name of a metadata from the indexed repository, the metadata value is automatically copied to the field, even when they are not formally associated in a mapping file.
-
The standard mapping file schema is supported by all connectors written in C# (all connectors except Web Legacy). However, it is recommenced for the connectors that use their own mappings (such as Oracle UCM) to NOT mix these specific mappings with standard ones.
-
Some connectors come with a default mapping file that is available in the [CES_Path]\bin folder, The mapping file name is in the form:
Coveo.CES.CustomCrawlers.[ConnectorName].MappingFile.xml
When a default mapping file is available, it is recommended to start with its content by using and customizing a copy of the file.
This mapping file format is used by more recently developed or updated connectors. This standard mapping file only contains metadata to field mappings, not other connector configuration parameters. When needed, a connector rather uses a separate configuration file for non-mapping parameters.
Some connectors using mapping file with this schema:
-
Jive (see Creating and Using a Jive Mapping File)
-
Lithium
-
SharePoint (see Creating and Using a Custom SharePoint Mapping File)
-
Sitecore (see Creating and Using a Sitecore Mapping File)
The format of the mapping file version 1 is specified in the following XML schema definition (XSD).
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- definition of possible elements -->
<xs:element name="Mappings">
<xs:complexType>
<xs:sequence>
<xs:element name="Version" minOccurs="1" maxOccurs ="1" />
<xs:element name="CommonMapping" type="GenericMapping" minOccurs="0" maxOccurs ="1"/>
<xs:element name="Mapping" type="SpecificMapping" minOccurs="0" maxOccurs ="unbounded"/>
<xs:element name="DefaultMapping" type="GenericMapping" minOccurs ="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:unique name="mappings">
<xs:selector xpath="Mapping"/>
<xs:field xpath="@type"/>
</xs:unique>
</xs:element>
<!-- definition of generic (common and default) mapping section -->
<xs:complexType name="GenericMapping">
<xs:group ref="MappingElement" />
</xs:complexType>
<!-- definition of a specific mapping section -->
<xs:complexType name ="SpecificMapping">
<xs:group ref="MappingElement" />
<xs:attribute name="type" use=" required" />
</xs:complexType>
<!-- definition of a mapping element.-->
<xs:group name="MappingElement">
<xs:all>
<xs:element name ="Title" minOccurs="0" maxOccurs = "1"/>
<xs:element name="Body" minOccurs="0" maxOccurs = "1"/>
<xs:element name="ClickableUri" minOccurs="0" maxOccurs = "1"/>
<xs:element name="PrintableUri" minOccurs="0" maxOccurs = "1"/>
<xs:element ref="Fields" minOccurs="0" maxOccurs = "1"/>
</xs:all>
</xs:group>
<!-- definition of fields element -->
<xs:element name="Fields">
<xs:complexType>
<xs:sequence>
<xs:element ref="Field" minOccurs="0" maxOccurs = "unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:unique name="field">
<xs:selector xpath="Field"/>
<xs:field xpath="@name"/>
</xs:unique>
</xs:element>
<!-- definition of field element -->
<xs:element name="Field">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="name" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:schema>
Example: The JIVE connector uses the standard mapping file schema:
<?xml version="1.0" encoding="utf-8" ?>
<Mappings>
<Version>1</Version>
<CommonMapping>
<Fields>
<Field name="sysauthor">%[author.displayName]</Field>
<!-- Jive system fields -->
<Field name="syscstag">%[tags]</Field>
<Field name="syscstaggroup">%[categories]</Field>
<Field name="syscsplace">%[coveo.places.titles]</Field>
<Field name="syscsplacetype">%[coveo.places.types]</Field>
</Fields>
</CommonMapping>
<Mapping type="announcement">
<Title>%[subject]</Title>
<Body><![CDATA[ <html> %[content.text] </html> ]]></Body>
<Fields>
<Field name="sysfiletype">csannouncement</Field>
<!-- Jive system fields -->
<Field name="syscsitemtype">Announcement</Field>
</Fields>
</Mapping>
<Mapping type="attachment">
<Title>%[name]</Title>
<Fields>
<Field name="sysfilename">%[name]</Field>
</Fields>
</Mapping>
<Mapping type="checkpoint">
<Title>%[name]</Title>
<Body>%[description]</Body>
<Fields>
<Field name="sysdtdue">dueDate</Field>
<Field name="sysfiletype">cscheckpoint</Field>
<!-- Jive system fields -->
<Field name="syscsitemtype">Checkpoint</Field>
</Fields>
</Mapping>
<Mapping type="comment">
<Title>%[subject]</Title>
<Body><![CDATA[ <html> %[content.text] </html> ]]></Body>
<Fields>
<Field name="sysfiletype">cscomment</Field>
<!-- Jive system fields -->
<Field name="syscsitemtype">Comment</Field>
</Fields>
</Mapping>
<Mapping type="discussion">
<Title>%[subject]</Title>
<Body><![CDATA[ <html> %[content.text] </html> ]]></Body>
<Fields>
<Field name="sysfiletype">csdiscussion</Field>
<!-- Jive system fields -->
<Field name="syscsitemtype">Discussion</Field>
</Fields>
</Mapping>
<Mapping type="dm">
<Title>%[subject]</Title>
<Body><![CDATA[ <html> %[content.text] </html> ]]></Body>
<Fields>
<Field name="sysfiletype">csdm</Field>
<!-- Jive system fields -->
<Field name="syscsitemtype">dm</Field>
</Fields>
</Mapping>
<Mapping type="document">
<Title>%[subject]</Title>
<Body><![CDATA[ <html> %[content.text] </html> ]]></Body>
<Fields>
<Field name="sysfilename">%[subject]</Field>
<Field name="sysfiletype">csdocument</Field>
<!-- Jive system fields -->
<Field name="syscsitemtype">Document</Field>
</Fields>
</Mapping>
<Mapping type="file">
<Title>%[subject]</Title>
<Fields>
<Field name="sysfilename">%[subject]</Field>
</Fields>
</Mapping>
<Mapping type="group">
<Title>%[name]</Title>
<Body>%[description]</Body>
<Fields>
<Field name="sysauthor">%[creator.displayName]</Field>
<Field name="sysfiletype">cssocialgroup</Field>
<!-- Jive system fields -->
<Field name="syscsitemtype">Social Group</Field>
</Fields>
</Mapping>
<Mapping type="idea">
<Title>%[subject]</Title>
<Body><![CDATA[ <html> %[content.text] </html> ]]></Body>
<Fields>
<Field name="sysfiletype">csidea</Field>
<!-- Jive system fields -->
<Field name="syscsitemtype">Idea</Field>
</Fields>
</Mapping>
<Mapping type="message">
<Title>%[subject]</Title>
<Body><![CDATA[ <html> %[content.text] </html> ]]></Body>
<Fields>
<Field name="sysfiletype">csmessage</Field>
<!-- Jive system fields -->
<Field name="syscsitemtype">Message</Field>
</Fields>
</Mapping>
<Mapping type="person">
<Title>%[displayName]</Title>
<Body> %[displayName] %[emails(work).value] %[jive.profile(Title).value]</Body>
<Fields>
<Field name="UserProfile_FirstName">%[name.givenName]</Field>
<Field name="UserProfile_LastName">%[name.familyName]</Field>
<Field name="UserProfile_AccountName">%[jive.username]</Field>
<Field name="UserProfile_Title">%[jive.profile(Title).value]</Field>
<Field name="UserProfile_AboutMe">%[jive.profile(Biography).value]</Field>
<Field name="UserProfile_PictureURL">%[thumbnailUrl]</Field>
<Field name="UserProfile_WorkEmail">%[emails(work).value]</Field>
<Field name="UserProfile_WorkPhone">%[phoneNumbers(work).value]</Field>
<Field name="mobile">%[phoneNumbers(mobile).value]</Field>
<Field name="syslocation">%[location]</Field>
<Field name="sysfiletype">csuser</Field>
<!-- Jive system fields -->
<Field name="syscsitemtype">User</Field>
</Fields>
</Mapping>
<Mapping type="poll">
<Title>%[subject]</Title>
<Body><![CDATA[ <html> %[content.text] </html> ]]></Body>
<Fields>
<Field name="sysfiletype">cspoll</Field>
<!-- Jive system fields -->
<Field name="syscsitemtype">Poll</Field>
</Fields>
</Mapping>
<Mapping type="post">
<Title>%[subject]</Title>
<Body><![CDATA[ <html> %[content.text] </html> ]]></Body>
<Fields>
<Field name="sysfiletype">csblogpost</Field>
<!-- Jive system fields -->
<Field name="syscsitemtype">Blog Post</Field>
</Fields>
</Mapping>
<Mapping type="project">
<Title>%[name]</Title>
<Body>%[description]</Body>
<Fields>
<Field name="sysdtdue">dueDate</Field>
<Field name="sysauthor">%[creator.displayName]</Field>
<Field name="sysfiletype">csproject</Field>
<!-- Jive system fields -->
<Field name="syscsitemtype">Project</Field>
</Fields>
</Mapping>
<Mapping type="space">
<Title>%[name]</Title>
<Body>%[description]</Body>
<Fields>
<Field name="sysfiletype">cscommunity</Field>
<!-- Jive system fields -->
<Field name="syscsitemtype">Community</Field>
</Fields>
</Mapping>
<Mapping type="systemblog">
<Title>%[name]</Title>
<Body>%[description]</Body>
<Fields>
<Field name="sysfiletype">cssystemblog</Field>
<!-- Jive system fields -->
<Field name="syscsitemtype">System Blog</Field>
</Fields>
</Mapping>
<Mapping type="task">
<Title>%[subject]</Title>
<Body><![CDATA[ <html> %[content.text] </html> ]]></Body>
<Fields>
<Field name="sysdtdue">dueDate</Field>
<Field name="sysfiletype">cstask</Field>
<!-- Jive system fields -->
<Field name="syscsitemtype">Task</Field>
<Field name="syscstaskassignedto">%[owner.extra.displayName]</Field>
</Fields>
</Mapping>
<Mapping type="update">
<Title>%[subject]</Title>
<Body><![CDATA[ <html> %[content.text] </html> ]]></Body>
<Fields>
<Field name="sysfiletype">csupdate</Field>
<!-- Jive system fields -->
<Field name="syscsitemtype">Update</Field>
</Fields>
</Mapping>
<Mapping type="video">
<Title>%[subject]</Title>
<Body><![CDATA[ <html> %[content.text] </html> ]]></Body>
<Fields>
<Field name="sysfiletype">csvideo</Field>
<!-- Jive system fields -->
<Field name="syscsitemtype">Video</Field>
</Fields>
</Mapping>
</Mappings>