Saturday, March 24, 2012

Alternate Access Mappings in Cross-Farm Search Scenario

Alternate Access Mappings (AAM) is a key functionality of Microsoft SharePoint platform to manage user access to the SharePoint content from different environments. The environment is usually a network zone like intranet, Internet or extranet, but this is not a rule as the AAM can be used also to differentiate the access to the content for various user communities within the same network zone.

The basis of AAM is the ability to configure different URLs for the same SharePoint web application. Search service application (SSA) leverages AAM for altering URLs in search results, so that the users get always the links with expected URLs. Detailed explanation of AAM usage and functionality in single farm environment is quite well known and described in many documents and blog posts. Just for the sake of completeness, here are few good links:
This post is focused on a little bit different scenario. Let’s imagine you have multiple Microsoft SharePoint Server 2010 farms in your environment. You have an Enterprise Services farm providing shared capacity and functionality to the other farms. This farm is running the SSA and also other service applications which can be published and consumed in cross-farm scenarios. The other farms, which are Internet Publishing and Intranet Collaboration, consume the SSA.

The SSA crawl the content on both consuming farms and everything works fine as long as the users are accessing the content hosted on the farms through the same URLs as those used for the content crawling. One day you decide that you want to make the Search configuration a bit more flexible for URL changes, which are time to time requested by the business units. In current setup it is very time consuming task, because any time you change the URL you have to perform full crawl to reflect the URL changes in the search index.

You make a decision to configure additional authentication zone in each consuming farm (Internet zone for the Internet Publishing and Intranet zone for the Intranet Collaboration farm) and provide users with the public URLs configured in AAM for those zones. The search crawling will continue in using the original public URLs configured for the Default authentication zone of the consuming farms hosted web applications. The advantage of this concept is that you can change the public URL in the other zones any time you wish and the change will be immediately reflected in the search results.

This approach perfectly works in the environment with just one SharePoint farm, but in the cross-farm scenario you get completely different user experience. The search results in the cross-farm scenario will contain only the URLs accessed during content crawling, but not the public URLs configured in AAM for the other zones. This is because the SSA on the Enterprise Services farm does not know anything about the AAM configuration on the Internet Publishing and Intranet Collaboration farms. 

Figure 1: Cross-Farm search without a dummy AAM configuration

The workaround for this SharePoint technology limitation is to create a dummy AAM configuration on the Enterprise Services farm for the public URLs configured on the consuming farms AAM.

First of all you need to create one or more web applications on the Enterprise Service farm. The web application should be created for each URL you want to be returned in the search results. Those dummy web applications on the Enterprise Services farm will not ever be accesses by users, so you should not expect any additional resource consumption as these web applications will even not host any site collections. The only purpose for the dummy web applications is to provide a foundation for the AAM configuration.

The AAM for each dummy web application should be configured with the public URL corresponding to the public URL configured on the consuming farm as that is the URL value you expect to be returned in the search results. The internal URL should be configured with the value of the URL accessed by SSA during the content crawling. See the following picture to better understand the concept.

Figure 2: Cross-Farm search with a dummy AAM configuration

The AAM on the Enterprise Services farm is going to map the internal URLs to specific public URL and this is exactly what we wanted to achieve to get correct links in the search results.

There is off course a limitation in this workaround approach. The limitation is related to the nature of the internal and public URLs. You may know that you can have multiple internal URLs for single public URL, but the internal URLs cannot be identical for different public URLs. This is because the AAM would not be able to identify and associate the correct public URL to the requested internal URL. Due to this fact it is possible to apply this workaround only for single alternative URL, which means only one additional authentication zone for each web application hosted on the consuming farms.

No comments:

Post a Comment