Three useful managed properties for working with Office Web Apps
This post is over a year old, some of this information may be out of date.
When working in Office 365 / SharePoint on-premises you probably already used Office Web Apps (OWA) to create or modify your documents. The power of OWA is also leveraged inside a SharePoint Search Center to show the content of the document inside the hover panel.

This kind of functionality is very helpful for finding the document you are searching for. You can also leverage the OWA functionality inside your own display templates by making use of the following managed properties:
- ServerRedirectedURL
- ServerRedirectedPreviewURL
- ServerRedirectedEmbedURL
Each property has its own purpose. In the next sections I will explain them one by one.
ServerRedirectedURL managed property
The ServerRedirectedURL managed property provides you a link which opens the document in OWA. You can use this managed property if you want your users to open the documents in OWA instead of their client applications.
Sample managed property value: https://tenant.sharepoint.com/sites/Operations/_layouts/WopiFrame.aspx?sourcedoc={9AF85718-3C5A-4FEC-9777-BBE609E610EC}&file=New%20Training%20Programs.pptx&action=default&DefaultItemOpen=1
Usage: You can use this managed property value inside an anchor tag.
<!--#_var serverRedirectedURL = $getItemValue(ctx, 'ServerRedirectedURL');_#--><a href="_#= serverRedirectedURL =#_" title="ServerRedirectedURL">Link to the document in OWA</a>

ServerRedirectedPreviewURL managed property
The ServerRedirectedPreviewURL managed property can be used to add a preview image next to the content of the document like in your SharePoint Search Center.

Sample managed property value: https://tenant.sharepoint.com/sites/Operations/_layouts/WopiFrame.aspx?sourcedoc={9af85718-3c5a-4fec-9777-bbe609e610ec}&action=imagepreview
Usage: You can use this managed property value as the source attribute of an image tag.
<!--#_var serverRedirectedPreviewURL = $getItemValue(ctx, 'ServerRedirectedPreviewURL');_#--><img src="_#= serverRedirectedPreviewURL =#_" alt="ServerRedirectedPreviewURL" />

ServerRedirectedEmbedURL managed property
The ServerRedirectedEmbedURL managed property is the property that is used to render the WOPI frame inside the hover panels.
Sample managed property value: https://tenant.sharepoint.com/sites/Operations/_layouts/WopiFrame.aspx?sourcedoc={9af85718-3c5a-4fec-9777-bbe609e610ec}&action=interactivepreview
Usage: You can use this managed property value as the source attribute inside an iFrame.
<!--#_var serverRedirectedEmbedURL = $getItemValue(ctx, 'ServerRedirectedEmbedURL');if(!Srch.U.n(serverRedirectedEmbedURL)) {_#--> <div class="ms-srch-hover-viewerContainer" style="height:345px;200px"> <iframe src="_#= serverRedirectedEmbedURL =#_" scrolling="no" frameborder="0px" style="height:100%;width:100%"></iframe> </div><!--#_}_#-->

Adding these properties in your template
You need to add these managed properties to the ManagedPropertyMapping attribute inside the display template before you can start using them in your display templates.
<mso:ManagedPropertyMapping msdt:dt="string">'Link URL'{Link URL}:'Path','Line 1'{Line 1}:'Title','Line 2'{Line 2}:'','FileExtension','SecondaryFileExtension','ServerRedirectedEmbedURL','ServerRedirectedPreviewURL','ServerRedirectedURL'</mso:ManagedPropertyMapping>
On my GitHub repository you can find a sample display template with these properties: item display template with OWA properties.
Related articles
Creating Custom Refiner Control Display Templates for SharePoint 2013
Part 1: Create Your First Search Refiner Control Template
Part 2: Adding Refinement Actions to the Custom Search Refiner Control
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