OPEN TO WORK

Available for new opportunities! Let's build something amazing together.

Retrieve the web URL for a search result via a managed property

Crawled Property Managed Property Search
post

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.

Show image SharePoint Online - SPWebUrl property
SharePoint Online - SPWebUrl property

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.

Show image SharePoint 2013 - Crawled property
SharePoint 2013 - Crawled property
Show image SharePoint 2013 - SPWebUrl managed property
SharePoint 2013 - SPWebUrl managed property

Result

Show image SPWebUrl compared to the SPSiteUrl
SPWebUrl compared to the SPSiteUrl

Related articles

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

Elio Struyf

Solutions Architect & Developer Expert

Loading...

Let's build together

Manage content in VS Code

Present from VS Code