How to: Crawl Associated External Content Types

Learn how to use the search specific properties in the Business Data Connectivity (BDC) service metadata model for crawling associations, and the different user experiences that you can enable.

Applies to: SharePoint Server 2010

In this article
Crawling the Associated External Content Type
Crawling Associated External Content Type Attachments
Crawling Associated External Content Types as Child External Content Types

Microsoft Business Connectivity Services (BCS) enables you to link two related external content types, which then enables you to fetch related external content. For example, you can fetch external content from two Microsoft SQL Server database table-based external content types that are based on foreign keys. This concept of linking two related external content types is known as an association. For more information about associations, see Adding Associations Between External Content Types.

The Microsoft SharePoint Server 2010 search connector framework enables you to crawl associations.

Crawling the Associated External Content Type

In the context of the SharePoint Server search connector framework, the source external content type of an association is referred to as the parent external content type. SharePoint Server search can crawl external content types that are associated with the parent in two ways: as attachments or as children. These external content type associations affect the following:

  • User experience

  • Incremental crawls

  • Processing crawl deletions

User Experience Effects from External Content Type Associations

A child external content type has its own search result URL and profile page, if the profile page has been created. The search result URL is the URL that is displayed if the user searches for a term in the child external content type data.

The external content type for an attachment does not have its own search result URL. So if the user searches for a term in the attachment External Item, the URL for the parent external content type is displayed instead. You can set this URL to the profile page URL of the parent. The profile page for the parent external content type will display all the fields from the attachment external content type that are exposed by the association navigator.

Incremental Crawl Effects from External Content Type Associations

Child external items are recrawled and updated for timestamp-based incremental crawls if the timestamp of the child external item changes.

For attachment external content types, the timestamp of the parent external item is interpreted as the timestamp of the attachment external item. This means that any changes in the attachment external item are picked up by an incremental crawl only when the timestamp of the parent external item changes.

Processing Crawl Deletions Effects from External Content Type Associations

When processing crawl deletions, if the parent external content type is deleted from the index, SharePoint Server search deletes the associated attachment external content types and child external content types from the index.

Crawling Associated External Content Type Attachments

To mark an association so that it is crawled as an attachment, add the AttachmentAccessor property to the Association method instance, as follows.

<Association Name="AttachmentsNavigate Association" Type="AssociationNavigator" ...>
    <Properties>
        <Property Name="ForeignFieldMappings" Type="System.String">....... </Property>
        <Property Name="AttachmentAccessor" Type="System.String">x</Property>
    </Properties>
    <SourceEntity Namespace="ParentExternalContentType" Name="Parent" />
    <DestinationEntity Namespace="AttachmentExternalContentType" Name="Attachment External Content Type" />
</Association>

Note

You can specify any value for the AttachmentAccessor property; SharePoint Server search does not examine this value.

Crawling Associated External Content Types as Child External Content Types

To mark an association so that it is crawled as a child external content type, add the DirectoryLink property to the Association method instance, as follows.

<Association Name="ChildrenNavigator Association" Type="AssociationNavigator" ...>
    <Properties>
        <Property Name="DirectoryLink" Type="System.String">x</Property>
    </Properties>
    <SourceEntity Namespace="ParentExternalContentType" Name="Parent" />
    <DestinationEntity Namespace="ChildExternalContentType" Name="Child External Content Type" />
</Association>

Note

You can specify any value for the DirectoryLink property. SharePoint Server search does not examine this value.

See Also

Reference

Association Element in MethodInstances (BDCMetadata Schema)

Concepts

SharePoint Server Search Connector Framework

Adding Associations Between External Content Types

Other Resources

Step 4 (Optional): Define Associations