In our project, we are exposing the same SharePoint farms both outside and inside the company firewalls. For this, we are using Alternate Access Mapping (AAM) with a setup like this:
|Default||http://team.example.com||Internal users and crawling|
IMPORTANT NOTE: A dedicated services farm was used for crawling the team sites. As we later understood, it otherwise would have worked. Read on the see why.
In this scenario, the contextual search features, e.g. “This Site” and “This list” don’t work when accessing the site externally. The users never got any results:
But the user who accessed via the “Default” zone got results:
And, importantly, the external users got search results if the search via the “Search Center”. It was only the contextual search which failed.
With help from my colleague, Jon Waite, I understood that the problem is due to the dedicated services farm not being aware of the AAM settings on the farm that is crawled. Fortunately, SharePoint has provided an easy solution for giving the crawling farm a hint about this, via “External Resource Mapping”. This is the one link under “Alternate Access Mapping” which I previous never understood the purpose of:
If you click on this link, you get a description which is partly misleading:
It says it can be used for mapping “a resource outside of SharePoint”. More correct would be to say “outside this SharePoint farm”, i.e., on a remote farm, which is exactly what we need. To use it, we fill in values as in the example above, click “Save”. Then click “Add Internal URLs”, where we specify the “Extranet” URL. Again, somewhat confusing naming. The end result should look like this:
And that’s all you need to do! No recrawl or other updates are needed. I love it when things just work!