Retrieve the web URL for a search result via a managed property
This post is over a year old, some of this information may be out of date.
These days a lot of my work is done in Office 365, but I have customers that are still working on an on-premises environment. Sometimes when switching back to an on-premises environment you could be surprised by things that are not (yet) available.
This week I wanted to implement a link which goes directly to the site on which the search result item is located. On Office 365 (SharePoint Online) used a managed property called SPWebURL to achieve this.

But when I wanted to use the managed property on the client its on-premises environment, I noticed that this managed property is not available.
Now the good news is that the ows_taxId_SPLocationSite crawled property is available on-premises, but it is not yet mapped to a managed property. So what you can do is create a new managed property and map it with the ows_taxId_SPLocationSite crawled property, that way you can easily retrieve the web URL of the item.


Result

Related articles
Programmatically Setting the Fetched Properties to an Extended Search Core Result Web Part
Fix: People Search Box Has Layout Problems When Used Outside a Search Center
Fix: Search Box Suggestions Layout Problem When Used Outside a Search Center
Report issues or make changes on GitHub
Found a typo or issue in this article? Visit the GitHub repository to make changes or submit a bug report.
Comments
Let's build together
Manage content in VS Code
Present from VS Code