Apparently this is a very old trick (pre 2006). Just add the debugger command (and enable script debugging if your using IE).
Let’s look at what it takes to make a minor tweak to the out of the box search result in SharePoint 2013. Say my requirement is to show the document id in the search result like the sample shown below.
For the example above I’m going to create a custom display template for PowerPoint files.
Let’s start by mapping the display templates folder as a local drive. Browse to /_layouts/15/DesignMapDrive.aspx and click on the /_catalogs/masterpage/ link to open the drive. You can then map that as a network drive.
Through explorer browser to the \_catalogs\masterpage\Display Templates\Search folder and copy these two files file to a local drive.
Rename Item_PowerPoint.html to make it your own.
Open up the file and change the <title> node. This is what get’s displayed in SharePoint.
Make the changes highlighted below.
Upload your custom html file to Search display templates mapped folder.
Now browse to the Manage Result Types page from Site Collection Administration and make a copy of the Microsoft PowerPoint result type.
From the Actions drop down pick the display template that you just uploaded and your all set.
I’m currently working on a Search First migration to SharePoint 2013. This post is a placeholder to document the gotchas and workarounds.
Search Centre Keywords
Our initial plan was for a search-first migration where we would swap out the FAST search service application for an SP2013 search service application. The idea was that we would make no changes to the existing search centres but they would get a better/fast search engine with all the improvements that come in 2013.
Issue: Keywords defined in the SP 2010 Search Centre are ignored by SP2013 Search. The only way this functionality can work is when you use a SP2013 search centre. This is not a problem if you have only one search centre since you can manage the keywords at a farm level but we had a number of search centres with site collection admins needing the ability to manage the keywords for the site they manage.
Workaround: We were forced to create Search Centres in SP 2013 and have the SP 2010 sites use the new search centres.
XSLT to Display Templates
Given that we were on the path to using SP2013 search centres any customisations that were made to the SP2010/FAST search XSL now needs to be re-written as Display Templates. In a way this is better than having to mess with XSL, but this is still something that you need to take into account.
XPathTool is a really great online XPath utility. It’s free, doesn’t need to be installed and has more features than a lot of the utilities that you find on CodePlex.
Invoke-RestMethod in PowerShell 3 doesn’t send the appropriate header required by SharePoint 2013 to return JSon results. It took me a while to figure out this workaround.
$parameter = "my search text"
$encParam = [System.Web.HttpUtility]::UrlEncode("'$parameter'")
$url = "http://mysp2013site/_api/search/query?querytext=$encParam"
$wc = new-object System.Net.WebClient
$wc.UseDefaultCredentials = $true
$wc.Headers.Add("Accept", "application/json; odata=verbose")
$res = $wc.DownloadString($url)