Thursday, February 11, 2016

Search schema mapping level explained

In SharePoint search you can map a crawled property to a managed property at basically three different levels. On-premises farm have SSA, site collection and site, while SPO have Tenant (subscription), site collection and site.

Search Service Application / Tenant

This is the top level, and mappings done at this level are inherited down to all site collections and sub sites.

Mappings for content outside of a SharePoint site collection like user profiles, hybrid crawled data, bcs, file crawls etc HAS to be mapped at this level.

Site collection

Mappings at a particular site collection will have effect for content stored on that site collection only, and only for searches executed in the context of the site collection. The last part is important. If you search center or search page is residing outside of the site collection where you did the mapping, then the mapping is not applicable. Any mapping is also inherited down to sub sites.

Site

Only for viewing the schema - no mapping possible.

Takeaway

If you map on a level besides the SSA/Tenant level, make sure the content you are mapping for resides at the level you map, and that queries executed also run in the same context. This means for a REST query you would set the API url to target the full URL of a site collection if that’s where the mapping is – https://server/site/mysite/_api/search/query, and not https://server/_api/search/query.

Read more at https://support.office.com/en-us/article/Manage-the-search-schema-in-SharePoint-Online-d4fab46d-ba41-4c03-9d4c-32b5b33198b6 and https://technet.microsoft.com/en-us/library/jj219667.aspx