<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SharePoint Search Archives : Binary Bits</title>
	<atom:link href="https://blog.binarybits.net/tag/sharepoint-search/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.binarybits.net/tag/sharepoint-search/</link>
	<description>Bits &#38; Pieces - A blog by Kannan Balasubramanian</description>
	<lastBuildDate>Wed, 17 May 2017 07:52:49 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>
	<item>
		<title>File Icons in SharePoint Search Results using Display Template</title>
		<link>https://blog.binarybits.net/file-icons-sharepoint-search-results-using-display-template/</link>
					<comments>https://blog.binarybits.net/file-icons-sharepoint-search-results-using-display-template/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Mon, 11 Jul 2016 05:44:37 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Display Templates]]></category>
		<category><![CDATA[SharePoint 2013]]></category>
		<category><![CDATA[SharePoint Search]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=777</guid>

					<description><![CDATA[<p>In SharePoint 2013 search results, the icon for a file type like .msg, .txt shows up as .html icon. In SharePoint 2010 this was overcome by mapping the icon file type in DocIcon.xml at WFE Servers. But now since access to WFE servers are restricted in on-prem environment and no access in O-365 environment, the [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/file-icons-sharepoint-search-results-using-display-template/">File Icons in SharePoint Search Results using Display Template</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In SharePoint 2013 search results, the icon for a file type like .msg, .txt shows up as .html icon.<br />
In SharePoint 2010 this was overcome by mapping the icon file type in DocIcon.xml at WFE Servers.</p>
<p>But now since access to WFE servers are restricted in on-prem environment and no access in O-365 environment, the only solution available is to do the following.</p>
<ol>
<li>Edit the existing display template (I use custom display template with results shown in table and following is based on that) or create a new template for existing for the following located at (SiteCollection/All Files/_catalogs/masterpage/Display Templates/Search) accessible by using SharePoint Designer.
<ol>
<li>xxxSearchTableResults.html</li>
<li>xxxSearchTableItem.html</li>
</ol>
</li>
<li>Add the following codes and it should show correct icons.</li>
</ol>
<p><strong>Search Results Display Template:</strong></p>
<pre class="lang:xhtml decode:true">&lt;div style="width:15px;display:table-cell;text-align:left;font-weight:bold;padding: 5px 0px 4px 10px;"&gt;                                       
&lt;/div&gt;</pre>
<p><strong>Search Item Display Template:</strong></p>
<pre class="lang:xhtml decode:true">&lt;div style="min-width:16px;max-width:16px;display: table-cell;white-space:nowrap;overflow:hidden;-ms-text-overflow:ellipsis;-o-text-overflow:ellipsis;text-overflow:ellipsis;"&gt;                                       
&lt;!--#_
 var extObj = new Object();
extObj["FileExtension"] = ctx.CurrentItem.FileExtension;
 var iconUrl = SP.Utilities.HttpUtility.htmlEncode(Srch.U.ensureAllowedProtocol(Srch.U.getIconUrlByFileExtension(extObj, null)));
if(ctx.CurrentItem.IsContainer)
iconUrl = "/_layouts/15/images/icdocset.gif";
if(ctx.CurrentItem.FileExtension === "msg")
iconUrl = "/_layouts/15/images/icmsg.gif";
//console.log(ctx.CurrentItem.FileExtension);
 _#--&gt;
&lt;img id="_#= $htmlEncode(id + Srch.U.Ids.icon) =#_" onload="this.style.display='inline'" src='_#= iconUrl =#_' /&gt;
 &lt;/div&gt;</pre>
<p><strong>Notes:</strong><br />
<em>ctx.CurrentItem.FileExtension</em> always return the file extension name which seems to match with the file name in the <em>/_layouts/15/images/</em> folder.</p>
<p>For example <strong>msg</strong> = ic<strong>msg</strong>.gif or ic<strong>msg</strong>.png</p>
<p>Once done, the search results will show-up as following</p>
<p><img decoding="async" class="alignnone size-full wp-image-781" src="https://blog.binarybits.net/wp-content/uploads/2016/07/Search-Icon.png" alt="Search-Icon" width="27" height="83" /></p>
<p>The post <a href="https://blog.binarybits.net/file-icons-sharepoint-search-results-using-display-template/">File Icons in SharePoint Search Results using Display Template</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/file-icons-sharepoint-search-results-using-display-template/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Using SharePoint 2010&#8217;s OOB search result to search in a particular library</title>
		<link>https://blog.binarybits.net/using-sharepoint-2010s-oob-search-result-to-search-in-a-particular-library/</link>
					<comments>https://blog.binarybits.net/using-sharepoint-2010s-oob-search-result-to-search-in-a-particular-library/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Sun, 12 Aug 2012 06:32:33 +0000</pubDate>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[SharePoint Library Search]]></category>
		<category><![CDATA[SharePoint Search]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=271</guid>

					<description><![CDATA[<p>There was a requirement to have a search text box and a button in landing page and show OOB search result from a single document library. After doing some analysis on OOB search the following is the code which we came up with. The technique is use the query string with query items &#8220;k=query&#8221;, &#8220;cs=This [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/using-sharepoint-2010s-oob-search-result-to-search-in-a-particular-library/">Using SharePoint 2010&rsquo;s OOB search result to search in a particular library</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>There was a requirement to have a search text box and a button in landing page and show OOB search result from a single document library.</p>
<p>After doing some analysis on OOB search the following is the code which we came up with.</p>
<p>The technique is use the query string with query items &#8220;k=query&#8221;, &#8220;cs=This List&#8221; &amp; &#8220;u=list&#8217;s absolute url&#8221;. Underlined items are the items which change dynamically.</p>
<blockquote><p>http://server/sites/site/_layouts/OSSSearchResults.aspx?k=MyQuery&amp;cs=This List&amp;u=http://server/sites/site/MyLibrary</p></blockquote>
<pre class="lang:default decode:true">&lt;div&gt;
    &lt;script type="text/javascript"&gt;
        function Search() {
            var libraryName = 'Library'; //Library Name            
            var url = window.location.protocol + "//" + window.location.host + _spPageContextInfo.siteServerRelativeUrl; //http://server/sites/&lt;sitecollection&gt; orhttp://server/sites/&lt;sitecollection&gt;/site
            var searchUrl = url + '/_layouts/OSSSearchResults.aspx';

            var queryText = document.getElementById('querybox').value;
            var queryUrl = searchUrl + '?k=' + queryText + '&amp;cs=This List&amp;u=' + url + '/' + libraryName; //http://server/sites/&lt;sitecollection&gt;/_layouts/OSSSearchResults.aspx?k=&lt;Query from input box&gt;&amp;cs=This List&amp;u=http://server/sites/&lt;site&gt;/&lt;Library Name&gt;

            window.navigate(queryUrl);
            //alert(queryUrl);
        }            
    &lt;/script&gt;
    &lt;input id="querybox" name="querybox" /&gt;
    &lt;input onclick="Search()" name="SearchInLibrary" value="Search In Adapter Document Library" type="button" /&gt;
&lt;/div&gt;</pre>
<p>The post <a href="https://blog.binarybits.net/using-sharepoint-2010s-oob-search-result-to-search-in-a-particular-library/">Using SharePoint 2010&rsquo;s OOB search result to search in a particular library</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/using-sharepoint-2010s-oob-search-result-to-search-in-a-particular-library/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Minified using Disk

Served from: blog.binarybits.net @ 2026-05-28 21:02:33 by W3 Total Cache
-->