Product DocsMenu

Coveo Platform 7.0 >
Administrator Help > Connectors > Microsoft SharePoint Connector > Creating and Using a Custom Mapping File

Creating and Using a Custom SharePoint Mapping File

A mapping file associates SharePoint metadata with Coveo index fields. SharePoint is essentially made of lists and list items. Each list has a Base List Type, to represent what it contains and how to interact with it.

Example: A Document Library list contains only documents. You can also add a Custom List which will contain generic list items. A user can have two Document Library lists, but decide to add more columns (metadata) to the second list.

CES 7.0.6607+ (April 2014) The Microsoft SharePoint connector comes with a default mapping file ([CES_Path]\bin\Coveo.CES.CustomCrawlers.SharePoint.MappingFile.xml) that contains mappings for all standard list types. Using the default mapping file allows to index standard SharePoint content.

While the content of custom metadata such as custom columns in a list are mapped to default fields, in a case where you identify custom metadata that are not properly mapped, you can consider creating and using a custom mapping file to ensure that custom metadata content is mapped to specific fields.

Note: In a custom SharePoint mapping file, you must refer to the custom SharePoint fields using the name that begins with the out-of-the-box ows_ (Office Web Server) namespace prefix (see What does “ows” means and why people use it before name of a field).

You may identify a SharePoint metadata name from the SharePoint URL (see Determining the Name of a SharePoint Metadata Tag).

The SharePoint connector can put multiple mapping types in the MappingType property for every item, separated by semicolons, before being sent to the index.

These mapping types are arranged in order of more to less specific:

  • Item type + ID (a GUID)

  • Item type + Title

  • Item type + Base type

Example: An item of a Contact list can have the following MappingType:

ListItem.{432-1123243434-343331};ListItem.My Contact List;ListItem.Contacts

Items other than List and List Items have their ID and name:

Web.{58943-43849273-483922};Web.MyWeb

For all documents, the DocumentType property is set to the base item type (for example: ListItem).

Consequently, as shown in the following example, a mapping file can specifically map a set of lists or a single list to a particular set of fields.

Important: Semicolons (;) are used to separate items in the mapping file. When you want to map an item that has a ; character in its title, remove the character in the MappingType property (<Mapping type="[Item title]">).

<?xml version="1.0" encoding="utf-8"?>
<Mappings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Version>1</Version>
  <CommonMapping>
    <Fields />
  </CommonMapping>
  ...
  <Mapping type="ListItem.Announcements">
    <Title>%[coveo_SiteName] - %[Title]</Title>
    <Body>%[Description]</Body>
    <Fields />
  </Mapping>

  <Mapping type="ListItem.GenericList.My custom list">
    <Title>%[coveo_SiteName] - %[Title]</Title>
    <Body>%[Description]</Body>
    <Fields>
      <Field name="myfield1">%[ows_customTextColumn1]</Field>
      <Field name="myfield2">%[ows_customTextColumn2]</Field>
      <Field name="myfield3">%[ows_customTextColumn3]</Field>
    </Fields>
  </Mapping>
  
  <Mapping type="ListItem.{432-1123243434-343331}">
    <Title>%[coveo_SiteName] - %[Title]</Title>
    <Body>%[Description]</Body>
    <Fields>
      <Field name="myfield4">%[ows_customTextColumn4]</Field>
      <Field name="myfield5">%[ows_customTextColumn5]</Field>
      <Field name="myfield6">%[ows_customTextColumn6]</Field>
    </Fields>
  </Mapping>
  
  <Mapping type="Web.MyWebApp">
    <Fields>
      <Field name="syssearchablemeta">%[Description]</Field>
      <Field name="mywebstuff">%[some_metadata]</Field>
    </Fields>
  </Mapping>
</Mappings>

To create a custom SharePoint mapping file

  1. Using an administrator account, connect to the Coveo Master server.

  2. Copy the default mapping file ([CES_Path]\bin\Coveo.CES.CustomCrawlers.SharePoint.MappingFile.xml) and rename the copy in a folder under [Index_Path]\Config\ to ensure the file is part of your index configuration.

    Example: When your index is on the D: drive and you are indexing your SharePoint 2013 intranet, rename the copy of the default mapping file to: 

    D:\CES70\Config\Connectors\SharePoint2013IntranetMapping.xml

  3. Using a text editor, modify existing mappings or add new ones to specifically map your custom metadata.

    Note: The SharePoint mapping file must respect the standard mapping file schema (see Standard Mapping File Schema).

What's Next?

People who viewed this topic also viewed