<?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>Search Nuggets &#187; Mikael Svenson</title>
	<atom:link href="http://blog.comperiosearch.com/blog/author/msvenson/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.comperiosearch.com</link>
	<description>A blog about Search as THE solution</description>
	<lastBuildDate>Mon, 13 Jun 2016 08:59:45 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=3.9.40</generator>
	<item>
		<title>Deleting a Federated Location via the API</title>
		<link>http://blog.comperiosearch.com/blog/2011/06/22/deleting-a-federated-location-via-the-api/</link>
		<comments>http://blog.comperiosearch.com/blog/2011/06/22/deleting-a-federated-location-via-the-api/#comments</comments>
		<pubDate>Wed, 22 Jun 2011 12:51:00 +0000</pubDate>
		<dc:creator><![CDATA[Mikael Svenson]]></dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[sp2010]]></category>

		<guid isPermaLink="false">http://nuggets.comperiosearch.com/2011/06/deleting-a-federated-location-via-the-api/</guid>
		<description><![CDATA[I’m working on a SharePoint feature which will automatically add a federated search location on feature activation and which will delete it on de-activation. To accomplish this I use the Microsoft.Office.Server.Search.Administration.SearchServiceApplication class, and more specifically the AddNewLocationConfiguration and DeleteLocationConfiguration methods. I tried to use the same methods of the SearchServiceApplicationProxy first, but there seems to [...]]]></description>
				<content:encoded><![CDATA[<p>I’m working on a SharePoint feature which will automatically add a federated search location on feature activation and which will delete it on de-activation.</p>
<p>To accomplish this I use the <a href="http://msdn.microsoft.com/en-us/library/microsoft.office.server.search.administration.searchserviceapplication.aspx">Microsoft.Office.Server.Search.Administration.SearchServiceApplication</a> class, and more specifically the <a href="http://msdn.microsoft.com/en-us/library/microsoft.office.server.search.administration.searchserviceapplication.addnewlocationconfiguration.aspx">AddNewLocationConfiguration</a> and <a href="http://msdn.microsoft.com/en-us/library/microsoft.office.server.search.administration.searchserviceapplication.deletelocationconfiguration.aspx">DeleteLocationConfiguration</a> methods. I tried to use the same methods of the SearchServiceApplicationProxy first, but there seems to be an error using the AddNewLocationConfiguration method on proxy object.</p>
<p>AddNewLocationConfiguration takes a LocationConfiguration object as parameter, which can be created by loading in the xml from an OSDX file like this:</p>
<p><span style="font-family: 'Courier New'; font-size: small;">var searchLocation = new LocationConfiguration();<br />
var stream = …stream to xml file…;<br />
searchLocation.Import(stream);</span></p>
<p>As you see, adding is not too hard, but deleting is the problem. The DeleteLocationConfiguration method takes the id of a LocationConfiguration object as the parameter. But lo and behold, the Id property is defined as internal.</p>
<p><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://blog.comperiosearch.com/wp-content/uploads/2011/06/image1.png" border="0" alt="image" width="497" height="366" /></p>
<p><span id="more-535"></span>That means it’s not available for us to delete on. But we’re lucky to use .Net where reflection is possible. Buy using the helper class below we can get the value from the internal property. Note that the code could have used regular reflection, but emitting IL makes more optimized code, and I use this utility class a lot of other places where performance is an issue.</p>
<div>
<pre class="crayon-plain-tag">&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; DynamicReflectionHelperforObject&amp;lt;V&amp;gt;{
    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;delegate&lt;/span&gt; T GetPropertyFieldDelegate&amp;lt;T&amp;gt;(V obj);

    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;static&lt;/span&gt; GetPropertyFieldDelegate&amp;lt;C&amp;gt; GetP&amp;lt;C&amp;gt;(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; memberName)
    {
        Type v = &lt;span class=&quot;kwrd&quot;&gt;typeof&lt;/span&gt;(V);
        PropertyInfo pi = v.GetProperty(memberName, BindingFlags.NonPublic | BindingFlags.Instance);
        &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (pi == &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;)
            &lt;span class=&quot;kwrd&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; NullReferenceException(&lt;span class=&quot;str&quot;&gt;&quot;No Property or Field&quot;&lt;/span&gt;);

        DynamicMethod dm = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; DynamicMethod(&lt;span class=&quot;str&quot;&gt;&quot;GetPropertyorField_&quot;&lt;/span&gt; + memberName, &lt;span class=&quot;kwrd&quot;&gt;typeof&lt;/span&gt;(C), &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; Type[] { v }, v.Module);        ILGenerator il = dm.GetILGenerator();
        il.Emit(OpCodes.Ldarg_0); &lt;span class=&quot;rem&quot;&gt;// loaded c, c is the return value
&lt;/span&gt;        il.EmitCall(OpCodes.Call, pi.GetGetMethod(&lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;), &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;);
        il.Emit(OpCodes.Ret);
        &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; (GetPropertyFieldDelegate&amp;lt;C&amp;gt;)dm.CreateDelegate(&lt;span class=&quot;kwrd&quot;&gt;typeof&lt;/span&gt;(GetPropertyFieldDelegate&amp;lt;C&amp;gt;));
    }
}</pre>
</div>
<div>And to use it pass inn the object type, the property type and the object we want to retrieve the property from:</div>
<div>
<div id="codeSnippetWrapper">
<pre class="crayon-plain-tag">&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; id = Helpers.DynamicReflectionHelperforObject&amp;lt;LocationConfiguration&amp;gt;
   .GetProperty&amp;lt;&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;&amp;gt;(&lt;span class=&quot;str&quot;&gt;&quot;Id&quot;&lt;/span&gt;)
   .Invoke(frontLocation);
fastQuerySSA.DeleteLocationConfiguration(id);</pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2011/06/22/deleting-a-federated-location-via-the-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Document Thumbnails and PowerPoint Preview for your search results without installing FAST for SharePoint</title>
		<link>http://blog.comperiosearch.com/blog/2011/05/14/document-thumbnails-and-powerpoint-preview-for-your-search-results-without-installing-fast-for-sharepoint/</link>
		<comments>http://blog.comperiosearch.com/blog/2011/05/14/document-thumbnails-and-powerpoint-preview-for-your-search-results-without-installing-fast-for-sharepoint/#comments</comments>
		<pubDate>Sat, 14 May 2011 11:17:20 +0000</pubDate>
		<dc:creator><![CDATA[Mikael Svenson]]></dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[fast]]></category>
		<category><![CDATA[fs4sp]]></category>
		<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[sp2010]]></category>

		<guid isPermaLink="false">http://nuggets.comperiosearch.com/2011/05/document-thumbnails-and-powerpoint-preview-for-your-search-results-without-installing-fast-for-sharepoint/</guid>
		<description><![CDATA[[Originally posted at: http://techmikael.blogspot.com/2011/05/document-thumbnails-and-powerpoint.html] Microsoft offers three different flavors of search for SharePoint 2010: Foundation, Standard and Enterprise. For each level upwards you get more feature and better search capabilities. One of the visual features included with FAST for SharePoint is Thumbnails and Previews for the search results, as listed on the comparison table below (Compare [...]]]></description>
				<content:encoded><![CDATA[<p><em>[Originally posted at: <a title="Tech And Me" href="http://techmikael.blogspot.com/2011/05/document-thumbnails-and-powerpoint.html">http://techmikael.blogspot.com/2011/05/document-thumbnails-and-powerpoint.html</a>]</em></p>
<p>Microsoft offers three different flavors of search for SharePoint 2010: Foundation, Standard and Enterprise. For each level upwards you get more feature and better search capabilities. One of the visual features included with FAST for SharePoint is Thumbnails and Previews for the search results, as listed on the comparison table below (<a href="http://sharepoint.microsoft.com/en-us/buy/Pages/Editions-Comparison.aspx?Capability=Search">Compare SharePoint Editions – Search</a>).</p>
<p>Wouldn’t it be nice to have this feature on all versions of SharePoint? I will tell you how, as I demonstrated in a proof of concept talk at <a href="http://www.arcticsharepointchallenge.com/">Arctic SharePoint Challenge 2011</a>.</p>
<p><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="2011-04-28-Search-Thumbs-Preview-1" src="http://blog.comperiosearch.com/wp-content/uploads/2011/05/2011-04-28-Search-Thumbs-Preview-1.png" border="0" alt="2011-04-28-Search-Thumbs-Preview-1" width="504" height="410" /></p>
<p>The Thumbnail and Preview feature is depending on <a href="http://office.microsoft.com/en-us/web-apps/">Office Web Apps</a>, which is an additional module you can install on all versions of SharePoint 2010 in order to get web based editing capabilities of Office documents (Word, Excel, PowerPoint and OneNote). Office Web Apps itself is free, but requires Volume Licensing for Microsoft Office 2010.</p>
<p>The API’s used for generating the thumbnails and the PowerPoint previews are the <a href="http://download.microsoft.com/download/1/6/F/16F4E321-AA6B-4FA3-8AD3-E94C895A3C97/%5BMS-OMPWHP%5D.pdf">Office Mobile PowerPoint Web Handler Protocol</a> and the <a href="http://download.microsoft.com/download/1/6/F/16F4E321-AA6B-4FA3-8AD3-E94C895A3C97/%5BMS-OMWWH%5D.pdf">Office Mobile Word Web Handler Protocol</a>, both included with Office Web Apps. These API’s include functions to retrieve generated images of the documents as well as functions to retrieve the textual content within the documents. The API works for doc, docx, ppt and pptx files (Office 97-2010 formats).</p>
<p>The Word API is limited to generating a thumbnail for the first page in your document, while the PowerPoint API can generate an image of any slide as seen below.</p>
<p><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="2011-04-28-Search-Thumbs-Preview-2" src="http://blog.comperiosearch.com/wp-content/uploads/2011/05/2011-04-28-Search-Thumbs-Preview-2.png" border="0" alt="2011-04-28-Search-Thumbs-Preview-2" width="504" height="335" /></p>
<p>If you have installed the Enterprise version of SharePoint you have the possibility to create a new Search Center based on the “<em>FAST Search Center</em>” template, even though FAST is not installed.</p>
<p>The FAST Search Center template features XSLT in the Core Results Web Part which renders javascript calls to functions in a file called <em>search.js</em> located in the <em>_layouts</em> folder. Search.js further implements the communication with the mobile API’s to generate the images.</p>
<p>There are quite a few lines of javascript to implement this feature, but if you are a bit experienced with javascript and ajax programming you would be able to program this feature yourself. This will allow you to get thumbnails and PowerPoint previews with any version of SharePoint, from the free Foundation version to the Enterprise version.</p>
<p>If you are less handy with javascript you can copy out the XSLT used in the Core Results WebPart in the FAST Search Center site template, modify it some, and use it with a search site based on the “Enterprise Search Center” template instead. This way you will get additional visual improvements to the standard search page without having to install FAST.</p>
<p>The quick way is to replace some of the <em>xsl:params</em> set by the web part with pre-set variables instead. If you have FAST installed, then the parameters will be set via the Core Results Webpart. As we are using the oob search we have to set these parameters as variables instead.</p>
<p><span style="font-family: 'Envy Code R';"><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;"><span style="font-size: 9.5pt;">&lt;</span></span></span><span style="font-size: 9.5pt;"><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #2b91af;">xsl:variable</span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;"> </span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #ff0000;">name</span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;">=</span></span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="font-size: 9.5pt;"><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;">OpenPreviewLink</span></span><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;"> </span></span><span><span style="color: #ff0000;">select</span></span><span><span style="color: #0000ff;">=</span></span><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;">&#8216;Preview&#8217;</span></span><span style="color: #000000;">&#8220;</span></span><span><span style="font-size: 9.5pt; color: #0000ff;"> /&gt;</span></span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="font-family: 'Envy Code R';"><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;"><span style="font-size: 9.5pt;">&lt;</span></span></span><span style="font-size: 9.5pt;"><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #2b91af;">xsl:variable</span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;"> </span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #ff0000;">name</span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;">=</span></span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="font-size: 9.5pt;"><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;">ClosePreviewLink</span></span><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;"> </span></span><span><span style="color: #ff0000;">select</span></span><span><span style="color: #0000ff;">=</span></span><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;">&#8216;Close Preview&#8217;</span></span><span style="color: #000000;">&#8220;</span></span><span><span style="font-size: 9.5pt; color: #0000ff;"> /&gt;</span></span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="font-family: 'Envy Code R';"><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;"><span style="font-size: 9.5pt;">&lt;</span></span></span><span style="font-size: 9.5pt;"><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #2b91af;">xsl:variable</span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;"> </span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #ff0000;">name</span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;">=</span></span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="font-size: 9.5pt;"><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;">ThumbnailTooltipLoadingFailed</span></span><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;"> </span></span><span><span style="color: #ff0000;">select</span></span><span><span style="color: #0000ff;">=</span></span><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;">&#8216;Loading failed!&#8217;</span></span><span style="color: #000000;">&#8220;</span></span><span><span style="font-size: 9.5pt; color: #0000ff;"> /&gt;</span></span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="font-family: 'Envy Code R';"><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;"><span style="font-size: 9.5pt;">&lt;</span></span></span><span style="font-size: 9.5pt;"><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #2b91af;">xsl:variable</span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;"> </span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #ff0000;">name</span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;">=</span></span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="font-size: 9.5pt;"><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;">ThumbnailTooltipLoading</span></span><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;"> </span></span><span><span style="color: #ff0000;">select</span></span><span><span style="color: #0000ff;">=</span></span><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;">&#8216;Click to toggle preview&#8217;</span></span><span style="color: #000000;">&#8220;</span></span><span><span style="font-size: 9.5pt; color: #0000ff;"> /&gt;</span></span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="font-family: 'Envy Code R';"><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;"><span style="font-size: 9.5pt;">&lt;</span></span></span><span style="font-size: 9.5pt;"><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #2b91af;">xsl:variable</span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;"> </span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #ff0000;">name</span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;">=</span></span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="font-size: 9.5pt;"><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;">AAMZone</span></span><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;"> </span></span><span><span style="color: #ff0000;">select</span></span><span><span style="color: #0000ff;">=</span></span><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;">0</span></span><span style="color: #000000;">&#8220;</span></span><span><span style="font-size: 9.5pt; color: #0000ff;"> /&gt;</span></span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="font-family: 'Envy Code R';"><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;"><span style="font-size: 9.5pt;">&lt;</span></span></span><span style="font-size: 9.5pt;"><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #2b91af;">xsl:variable</span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;"> </span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #ff0000;">name</span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;">=</span></span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="font-size: 9.5pt;"><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;">PreviewWindowSize</span></span><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;"> </span></span><span><span style="color: #ff0000;">select</span></span><span><span style="color: #0000ff;">=</span></span><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;">160</span></span><span style="color: #000000;">&#8220;</span></span><span><span style="font-size: 9.5pt; color: #0000ff;"> /&gt;</span></span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="font-family: 'Envy Code R';"><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;"><span style="font-size: 9.5pt;">&lt;</span></span></span><span style="font-size: 9.5pt;"><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #2b91af;">xsl:variable</span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;"> </span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #ff0000;">name</span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;">=</span></span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="font-size: 9.5pt;"><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;">EnableDocumentPreviewPowerPoint</span></span><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;"> </span></span><span><span style="color: #ff0000;">select</span></span><span><span style="color: #0000ff;">=</span></span><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;">&#8216;true&#8217;</span></span><span style="color: #000000;">&#8220;</span></span><span><span style="font-size: 9.5pt; color: #0000ff;"> /&gt;</span></span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="font-family: 'Envy Code R';"><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;"><span style="font-size: 9.5pt;">&lt;</span></span></span><span style="font-size: 9.5pt;"><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #2b91af;">xsl:variable</span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;"> </span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #ff0000;">name</span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;">=</span></span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="font-size: 9.5pt;"><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;">EnableDocumentPreviewWord</span></span><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;"> </span></span><span><span style="color: #ff0000;">select</span></span><span><span style="color: #0000ff;">=</span></span><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;">&#8216;true&#8217;</span></span><span style="color: #000000;">&#8220;</span></span><span><span style="font-size: 9.5pt; color: #0000ff;"> /&gt;</span></span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="font-family: 'Envy Code R';"><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;"><span style="font-size: 9.5pt;">&lt;</span></span></span><span style="font-size: 9.5pt;"><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #2b91af;">xsl:variable</span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;"> </span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #ff0000;">name</span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;">=</span></span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="font-size: 9.5pt;"><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;">ConcurrentDocumentPreview</span></span><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;"> </span></span><span><span style="color: #ff0000;">select</span></span><span><span style="color: #0000ff;">=</span></span><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;">10</span></span><span style="color: #000000;">&#8220;</span></span><span><span style="font-size: 9.5pt; color: #0000ff;"> /&gt;</span></span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="font-family: 'Envy Code R';"><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;"><span style="font-size: 9.5pt;">&lt;</span></span></span><span style="font-size: 9.5pt;"><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #2b91af;">xsl:variable</span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;"> </span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #ff0000;">name</span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;">=</span></span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="font-size: 9.5pt;"><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;">TotalDocumentPreview</span></span><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;"> </span></span><span><span style="color: #ff0000;">select</span></span><span><span style="color: #0000ff;">=</span></span><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;">10</span></span><span style="color: #000000;">&#8220;</span></span><span><span style="font-size: 9.5pt; color: #0000ff;"> /&gt;</span></span></span></span></p>
<p>I also had to modify the xslt two more places. Around line 665 and line 725 locate the <em>FST_CheckForPreview</em> call and change the function parameter</p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="font-family: 'Envy Code R';"><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;"><span style="font-size: 9.5pt;"> </span></span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="font-family: 'Envy Code R';"><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;"><span style="font-size: 9.5pt;">&#8216;&lt;</span></span></span><span style="font-size: 9.5pt;"><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #2b91af;">xsl:value-of</span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;"> </span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #ff0000;">select</span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="color: #0000ff;">=</span></span></span><span style="mso-bidi-font-family: 'Envy Code R';"><span style="font-size: 9.5pt;"><span style="color: #000000;">&#8220;</span><span><span style="color: #0000ff;">sitename</span></span><span style="color: #000000;">&#8220;</span></span><span><span style="font-size: 9.5pt; color: #0000ff;">/&gt;&#8217;</span></span></span></span></p>
<p>with</p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="mso-bidi-font-family: 'Envy Code R';"><span style="font-family: 'Envy Code R';"><span style="font-size: 9.5pt; color: #0000ff;"> </span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="mso-bidi-font-family: 'Envy Code R';"><span style="font-family: 'Envy Code R';"><span style="font-size: 9.5pt; color: #0000ff;">&#8216;http://rootsite&#8217;</span></span></span></p>
<p>where rootsite is the name of your SharePoint server url.</p>
<p>This was to ensure the calls to the Mobile API went to the top level site, as they failed when called on sub-site url’s.</p>
<p>That being said, there are several other good reasons for deploying FAST for SharePoint in your organization besides these visual enhancements. Capabilities to enrich and modify your content prior to indexing, thus tailoring search experience towards the real needs of your users, as well as the powerful query capabilities offered via FAST Query Language are just a couple of arguments for choosing FAST.</p>
<p>But then again, it never hurts to have moderate amounts of eye-candy on your search page, as it will increase the perceived quality of the results.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2011/05/14/document-thumbnails-and-powerpoint-preview-for-your-search-results-without-installing-fast-for-sharepoint/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working with crawled and managed properties via code</title>
		<link>http://blog.comperiosearch.com/blog/2011/05/04/working-with-crawled-and-managed-properties-via-code/</link>
		<comments>http://blog.comperiosearch.com/blog/2011/05/04/working-with-crawled-and-managed-properties-via-code/#comments</comments>
		<pubDate>Wed, 04 May 2011 20:52:13 +0000</pubDate>
		<dc:creator><![CDATA[Mikael Svenson]]></dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[fast]]></category>
		<category><![CDATA[fs4sp]]></category>
		<category><![CDATA[sp2010]]></category>

		<guid isPermaLink="false">http://nuggets.comperiosearch.com/2011/05/working-with-crawled-and-managed-properties-via-code/</guid>
		<description><![CDATA[I was teaching a FAST for SharePoint Workshop today and we were doing labs on creating and mapping crawled properties to managed properties with the FAST Administration UI and via PowerShell. But one student wanted to know how to do this in code, hence this blog post. Instead of having a deployment script creating your [...]]]></description>
				<content:encoded><![CDATA[<p>I was teaching a FAST for SharePoint Workshop today and we were doing labs on creating and mapping crawled properties to managed properties with the FAST Administration UI and via PowerShell. But one student wanted to know how to do this in code, hence this blog post.</p>
<p>Instead of having a deployment script creating your properties, you could have an event receiver which creates your mappings once a site or list is provisioned. Or when some other action is going on.</p>
<p>So how do you go about doing this?</p>
<p>Well, first off Crawled and Managed Properties for FAST are a part of the index schema and is accessible via the following two namespaces:</p>
<p><strong><a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.search.extended.administration.aspx">Microsoft.SharePoint.Search.Extended.Administration</a></strong> <strong><a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.search.extended.administration.schema.aspx">Microsoft.SharePoint.Search.Extended.Administration.Schema</a></strong></p>
<p>which are the namespaces used for working with the FAST components.</p>
<p>Below is a quick example showing how this can be done in code, with comments along the way to guide the process. It’s all pretty straight forward.</p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span><span style="color: #0000ff;"><span style="font-size: 9.5pt;">const</span></span></span><span><span style="font-size: 9.5pt;"><span style="color: #000000;"> </span><span><span style="color: #0000ff;">string</span></span><span style="color: #000000;"> propertyName = </span><span><span style="color: #a31515;">&#8220;productname&#8221;</span></span><span style="color: #000000;">;</span></span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #008000;">// Get a reference to the Index Schema via the SchemaContext class</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span><span style="color: #2b91af;"><span style="font-size: 9.5pt;">SchemaContext</span></span></span><span><span style="font-size: 9.5pt;"><span style="color: #000000;"> schemaContext = </span><span><span style="color: #0000ff;">new</span></span><span style="color: #000000;"> </span><span><span style="color: #2b91af;">SchemaContext</span></span><span style="color: #000000;">();</span></span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span><span style="color: #2b91af;"><span style="font-size: 9.5pt;">Schema</span></span></span><span><span style="font-size: 9.5pt; color: #000000;"> schema = schemaContext.Schema;</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #000000;"> </span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #008000;">// Assign a guid to the custom Crawled Propery Category</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span><span style="color: #2b91af;"><span style="font-size: 9.5pt;">Guid</span></span></span><span><span style="font-size: 9.5pt;"><span style="color: #000000;"> myGuid = </span><span><span style="color: #0000ff;">new</span></span><span style="color: #000000;"> </span><span><span style="color: #2b91af;">Guid</span></span><span style="color: #000000;">(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1);</span></span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span><span style="color: #2b91af;"><span style="font-size: 9.5pt;">Category</span></span></span><span><span style="font-size: 9.5pt; color: #000000;"> catGroup;</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #008000;">// Create if it does not exist</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span><span style="color: #0000ff;"><span style="font-size: 9.5pt;">if</span></span></span><span><span style="font-size: 9.5pt; color: #000000;"> (!schema.AllCategories.Contains(myGuid))</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #000000;">{</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="color: #000000;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;"> </span></span><span style="font-size: 9.5pt;">catGroup = schema.AllCategories.Create(</span></span><span style="font-size: 9.5pt;"><span><span style="color: #a31515;">&#8220;My Crawled Properties&#8221;</span></span><span style="color: #000000;">, myGuid);</span></span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #000000;">}</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #0000ff;">else</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #000000;">{</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="color: #000000;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;"> </span></span><span style="font-size: 9.5pt;">catGroup = schema.AllCategories[myGuid];</span></span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #000000;">}</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #000000;"> </span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #008000;">// Create a new crawled property if it doesn&#8217;t exist</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span><span style="color: #2b91af;"><span style="font-size: 9.5pt;">CrawledProperty</span></span></span><span><span style="font-size: 9.5pt; color: #000000;"> cp = catGroup.GetAllCrawledProperties().Where(</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="color: #000000;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;"> </span></span><span style="font-size: 9.5pt;">c =&gt; c.Name == propertyName &amp;&amp; c.VariantType == 31 &amp;&amp; c.Propset == myGuid).FirstOrDefault();</span></span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span><span style="color: #0000ff;"><span style="font-size: 9.5pt;">if</span></span></span><span><span style="font-size: 9.5pt;"><span style="color: #000000;"> (cp == </span><span><span style="color: #0000ff;">null</span></span><span style="color: #000000;">) cp = catGroup.CreateCrawledProperty(propertyName, myGuid, 31);</span></span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #000000;"> </span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #008000;">// Create a new managed property if it doesn&#8217;t exist</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span><span style="color: #2b91af;"><span style="font-size: 9.5pt;">ManagedProperty</span></span></span><span><span style="font-size: 9.5pt; color: #000000;"> mp;</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span><span style="color: #0000ff;"><span style="font-size: 9.5pt;">if</span></span></span><span><span style="font-size: 9.5pt; color: #000000;"> (!schema.AllManagedProperties.Contains(propertyName))</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #000000;">{</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="color: #000000;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;"> </span></span><span style="font-size: 9.5pt;">mp = schema.AllManagedProperties.Create(propertyName, </span></span><span style="font-size: 9.5pt;"><span><span style="color: #a31515;">&#8220;&#8221;</span></span><span style="color: #000000;">, </span><span><span style="color: #2b91af;">ManagedType</span></span><span style="color: #000000;">.Text);</span></span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #000000;">}</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #0000ff;">else</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #000000;">{</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="color: #000000;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;"> </span></span><span style="font-size: 9.5pt;">mp = schema.AllManagedProperties[propertyName];</span></span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #000000;">}</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #000000;"> </span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #008000;">// Create a new crawled to managed property mapping if it doesn&#8217;t exit</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span><span style="color: #2b91af;"><span style="font-size: 9.5pt;">CrawledPropertyMapping</span></span></span><span><span style="font-size: 9.5pt; color: #000000;"> mapping = mp.GetCrawledPropertyMappings();</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span><span style="color: #0000ff;"><span style="font-size: 9.5pt;">if</span></span></span><span><span style="font-size: 9.5pt; color: #000000;"> (!mapping.Contains(cp))</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #000000;">{</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="color: #000000;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;"> </span></span><span style="font-size: 9.5pt;">mapping.Add(cp);</span></span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="color: #000000;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;"> </span></span><span style="font-size: 9.5pt;">mp.SetCrawledPropertyMappings(mapping);</span></span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #000000;">}</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #000000;"> </span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #008000;">// Get a reference to the default full text index (first one)</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span><span style="color: #2b91af;"><span style="font-size: 9.5pt;">FullTextIndex</span></span></span><span><span style="font-size: 9.5pt; color: #000000;"> fti = schema.AllFullTextIndecies.First();</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #000000;"> </span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #008000;">// Get the full text index mapping from the Managed Property</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span><span style="color: #2b91af;"><span style="font-size: 9.5pt;">FullTextIndexMappingCollection</span></span></span><span><span style="font-size: 9.5pt; color: #000000;"> fullTextIndexMappingCollection = mp.GetFullTextIndexMappings();</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span><span style="color: #2b91af;"><span style="font-size: 9.5pt;">FullTextIndexMapping</span></span></span><span><span style="font-size: 9.5pt; color: #000000;"> indexMapping =</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="color: #000000;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;"> </span></span><span style="font-size: 9.5pt;">fullTextIndexMappingCollection.Where(ftpMap =&gt; ftpMap.FullTextIndex.Name == fti.Name).FirstOrDefault();</span></span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #008000;">// Set a mapping to importance level 6, if it&#8217;s not already set to something else</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span style="font-family: Consolas;"><span><span style="color: #0000ff;"><span style="font-size: 9.5pt;">if</span></span></span><span><span style="font-size: 9.5pt;"><span style="color: #000000;"> (indexMapping == </span><span><span style="color: #0000ff;">null</span></span><span style="color: #000000;"> || !fullTextIndexMappingCollection.Contains(indexMapping))</span></span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #000000;">{</span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="color: #000000;"><span style="mso-spacerun: yes;"><span style="font-size: 9.5pt;"> </span></span><span style="font-size: 9.5pt;">fullTextIndexMappingCollection.Create(fti, 6);</span></span></span></span></p>
<p class="MsoNormal" style="line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;"><span><span style="font-family: Consolas;"><span style="font-size: 9.5pt; color: #000000;">}</span></span></span></p>
<p class="MsoNormal" style="line-height: 13pt; margin: 0cm 0cm 10pt;"><span style="font-family: Calibri;"><span style="font-size: 11pt; color: #000000;"> </span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2011/05/04/working-with-crawled-and-managed-properties-via-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Three Main Reasons Why You Should Upgrade to FAST for SharePoint</title>
		<link>http://blog.comperiosearch.com/blog/2011/05/02/three-main-reasons-why-you-should-upgrade-to-fast-for-sharepoint/</link>
		<comments>http://blog.comperiosearch.com/blog/2011/05/02/three-main-reasons-why-you-should-upgrade-to-fast-for-sharepoint/#comments</comments>
		<pubDate>Mon, 02 May 2011 19:23:04 +0000</pubDate>
		<dc:creator><![CDATA[Mikael Svenson]]></dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[fast]]></category>
		<category><![CDATA[fs4sp]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[sharepoint]]></category>

		<guid isPermaLink="false">http://nuggets.comperiosearch.com/2011/05/three-main-reasons-why-you-should-upgrade-to-fast-for-sharepoint/</guid>
		<description><![CDATA[I was fortunate to be one of three finalists in SharePoint Magazine’s Aspiring Author Contest. Today the article went live and I’m quite happy about it. You can read the article over at SharePoint Magazine, and if you like it feel free to click the Facebook Like button at the end. The other two finalists [...]]]></description>
				<content:encoded><![CDATA[<p>I was fortunate to be one of three finalists in SharePoint Magazine’s Aspiring Author Contest. Today the article went live and I’m quite happy about it.</p>
<p>You can read the article over at <a href="http://sharepointmagazine.net/articles/business-user/three-main-reasons-why-you-should-upgrade-to-fast-for-sharepoint">SharePoint Magazine</a>, and if you like it feel free to click the Facebook Like button at the end.</p>
<p>The other two finalists are:</p>
<p>“<a href="http://spm.to/23">Best Practices for SharePoint Groups</a>” by Josh McCarty and “<a href="http://spm.to/24">A Guide to Leaving Lotus Notes and Moving to Microsoft SharePoint</a>” by Andrew Vevers.</p>
<p>And if you are serious about search within SharePoint, go FAST!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2011/05/02/three-main-reasons-why-you-should-upgrade-to-fast-for-sharepoint/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding new nicknames to SharePoint People Search</title>
		<link>http://blog.comperiosearch.com/blog/2011/04/28/adding-new-nicknames-to-sharepoint-people-search/</link>
		<comments>http://blog.comperiosearch.com/blog/2011/04/28/adding-new-nicknames-to-sharepoint-people-search/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 13:49:06 +0000</pubDate>
		<dc:creator><![CDATA[Mikael Svenson]]></dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[sp2010]]></category>

		<guid isPermaLink="false">http://nuggets.comperiosearch.com/2011/04/adding-new-nicknames-to-sharepoint-people-search/</guid>
		<description><![CDATA[Out of the box SharePoint 2010 comes with a pretty good people search. This is due to a combination of phonetic rules and a vast list of nicknames. Out of the box the US English nickname list consists of over 14.000 nickname mappings, ensuring good results when trying to find people. But what if you [...]]]></description>
				<content:encoded><![CDATA[<p>Out of the box SharePoint 2010 comes with a pretty good people search. This is due to a combination of phonetic rules and a vast list of nicknames. Out of the box the US English nickname list consists of over 14.000 nickname mappings, ensuring good results when trying to find people.</p>
<p>But what if you are located in a different part of the world, speaking some obscure language like Norwegian, which is my native tongue, and where names are sounding nothing like English ones? What then?<span id="more-406"></span>Phonetics and nicknames are handled by the Microsoft Speech Platform. Default only en-us is installed, but you can download and install the runtime for your particular language. Your mileage seems to vary with how good the other language runtimes actually are, and my tests show that the English one usually gives the best results.</p>
<p>Still, you might have to add some nick names of your own. Here’s how:</p>
<p>SharePoint PowerShell has a command called <a href="http://technet.microsoft.com/en-us/library/ff608062.aspx">New-SPEnterpriseSearchLanguageResourcePhrase</a>. This command can take a Type parameter of <strong>Nickname</strong> (which for some reason is not listed on the TechNet page, but is documented on the <strong>Get</strong> version of the same command).</p>
<p>If I wanted to add the nickname <strong>slick</strong> for my own name, and vice versa I would execute the following PowerShell Commands:</p>
<p><span style="font-family: 'Courier New';">$ssa = Get-SPEnterpriseSearchServiceApplication FASTQuery </span></p>
<p><span style="font-family: 'Courier New';"> </span></p>
<p><span style="font-family: 'Courier New';"> </span><span style="font-family: 'Courier New';">New-SPEnterpriseSearchLanguageResourcePhrase –Name mikael -Language &#8220;en-US&#8221; –Type &#8220;Nickname&#8221; –Mapping slick -SearchApplication $ssa </span></p>
<p><span style="font-family: 'Courier New';"> </span></p>
<p><span style="font-family: 'Courier New';">New-SPEnterpriseSearchLanguageResourcePhrase –Name slick -Language &#8220;en-US&#8221; –Type &#8220;Nickname&#8221; –Mapping mikael -SearchApplication $ssa </span></p>
<p><span style="font-family: 'Courier New';"><span style="font-family: Georgia;"><strong>FASTQuery</strong> is the name of my Query SSA. Also note the <strong>Language</strong> parameter. Your query language has to match this in order for the nicknames to be used, and my suggestion is to set this to for the language you choose to use for phonetics and nicknames.</span></span></p>
<p><span style="font-family: 'Courier New';"><span style="font-family: Georgia;">Then in order to re-generate the language files run the command:</span></span></p>
<p><span style="font-family: 'Courier New';">Start-SPTimerJob -Identity &#8220;Prepare query suggestions&#8221;</span></p>
<p><span style="font-family: 'Courier New';"><span style="font-family: Georgia;">And your nicknames should be up and running from the search page.</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2011/04/28/adding-new-nicknames-to-sharepoint-people-search/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>DateTime resolution for querying FAST for SharePoint</title>
		<link>http://blog.comperiosearch.com/blog/2011/04/14/datetime-resolution-for-querying-fast-for-sharepoint/</link>
		<comments>http://blog.comperiosearch.com/blog/2011/04/14/datetime-resolution-for-querying-fast-for-sharepoint/#comments</comments>
		<pubDate>Thu, 14 Apr 2011 11:34:55 +0000</pubDate>
		<dc:creator><![CDATA[Mikael Svenson]]></dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[fast]]></category>
		<category><![CDATA[fs4sp]]></category>
		<category><![CDATA[sharepoint]]></category>

		<guid isPermaLink="false">http://nuggets.comperiosearch.com/2011/04/datetime-resolution-for-querying-fast-for-sharepoint/</guid>
		<description><![CDATA[I was doing range queries in the Search Center UI to limit documents between two exact dates. But no matter what I entered as hours/minutes/seconds in my query I still got the same result. There are good and bad news around this. The good news is that you can change the resolution from day to [...]]]></description>
				<content:encoded><![CDATA[<p>I was doing range queries in the Search Center UI to limit documents between two exact dates.</p>
<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2011/04/image.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://blog.comperiosearch.com/wp-content/uploads/2011/04/image_thumb.png" border="0" alt="image" width="504" height="214" /></a></p>
<p>But no matter what I entered as hours/minutes/seconds in my query I still got the same result.</p>
<p>There are good and bad news around this. The good news is that you can change the resolution from day to for example hours for your default <a href="http://technet.microsoft.com/en-us/library/ff191243.aspx">rank profile</a>:</p>
<p>$rank = Get-FASTSearchMetadataRankProfile<br />
$rank.FreshnessResolution = &#8220;Hour&#8221;<br />
$rank.Update()</p>
<p>The bad news is that the Search Center UI disregards this, and when monitoring the queries received by FAST all hours/minutes/seconds are stripped from the query. They are adjusted for time zones as you can see below where 00:00:00 is turned into 23:00:00 of the day before the original query.</p>
<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2011/04/image1.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://blog.comperiosearch.com/wp-content/uploads/2011/04/image_thumb1.png" border="0" alt="image" width="472" height="195" /></a></p>
<p>If you want to do date range queries on an interval less than a day you have to use the development API’s, and not the default Search page.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2011/04/14/datetime-resolution-for-querying-fast-for-sharepoint/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why you still should prefer PowerShell over UI to create Search Scopes in FAST for SharePoint</title>
		<link>http://blog.comperiosearch.com/blog/2011/03/30/why-you-still-should-prefer-powershell-over-ui-to-create-search-scopes-in-fast-for-sharepoint/</link>
		<comments>http://blog.comperiosearch.com/blog/2011/03/30/why-you-still-should-prefer-powershell-over-ui-to-create-search-scopes-in-fast-for-sharepoint/#comments</comments>
		<pubDate>Wed, 30 Mar 2011 07:40:00 +0000</pubDate>
		<dc:creator><![CDATA[Mikael Svenson]]></dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[sharepoint]]></category>

		<guid isPermaLink="false">http://nuggets.comperiosearch.com/2011/03/why-you-still-should-prefer-powershell-over-ui-to-create-search-scopes-in-fast-for-sharepoint/</guid>
		<description><![CDATA[When SharePoint 2010 came out the only way to create a search scope was to do it by PowerShell. Well, you could create the scope name itself via Central Admin, but the actual scope filter had to be done via PowerShell. If you picked up on what changes in the Cumulative SharePoint 2010 updates you [...]]]></description>
				<content:encoded><![CDATA[<p>When SharePoint 2010 came out the only way to create a search scope was to do it by PowerShell. Well, you could create the scope name itself via Central Admin, but the actual scope filter had to be done via PowerShell.<span id="more-362"></span></p>
<p><a href="http://nuggets.comperiosearch.com/wp-content/uploads/2011/03/image.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://nuggets.comperiosearch.com/wp-content/uploads/2011/03/image_thumb.png" border="0" alt="image" width="504" height="43" /></a></p>
<p>If you picked up on what changes in the Cumulative SharePoint 2010 updates you might have noticed that the <a href="http://support.microsoft.com/kb/2276339/" target="_blank">August 2010 release</a> changed this.</p>
<blockquote><p>When you create a search scope by using FAST Search, you have to have a scope filter that matches the scope rules attached to the search scope. However, the scope filter is empty and must be set manually by using PowerShell when you create a new search scope.</p></blockquote>
<p>But it’s not necessarily that easy. For every managed property you might have defined for FAST, you have to create a shadow copy/placeholder which you can use in your scope. There is a <a href="http://technet.microsoft.com/en-us/library/ff453895.aspx" target="_blank">9 step list at TechNet</a> outlining the procedure. Also the GUI limits you to filter on web address or a specific property, much like the keyword syntax in the search page.</p>
<p>By using PowerShell you have the full force of fql at your disposal, and no need to create placeholder properties. For example the following query will boost documents from a particular site, and from a particular department to the top of the list.</p>
<blockquote><p>xrank(path:starts-with(&#8220;http://site/&#8221;),escdeptname:ends-with(&#8220;1200&#8243;), boost=10000)</p></blockquote>
<p>It’s nice that GUI support is added, but I will still stick to PowerShell for scopes for the time being :-)</p>
<p style="font-size: 0.7em;"><a href="http://techmikael.blogspot.com/2011/03/why-you-still-should-prefer-powershell.html">[Originally</a> posted at: <a href="http://techmikael.blogspot.com/2011/03/why-you-still-should-prefer-powershell.html">http://techmikael.blogspot.com/2011/03/why-you-still-should-prefer-powershell.html</a>]</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2011/03/30/why-you-still-should-prefer-powershell-over-ui-to-create-search-scopes-in-fast-for-sharepoint/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Prototyping pipeline stages in PowerShell</title>
		<link>http://blog.comperiosearch.com/blog/2011/03/02/prototyping-pipeline-stages-in-powershell/</link>
		<comments>http://blog.comperiosearch.com/blog/2011/03/02/prototyping-pipeline-stages-in-powershell/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 10:56:10 +0000</pubDate>
		<dc:creator><![CDATA[Mikael Svenson]]></dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[fs4sp]]></category>
		<category><![CDATA[sp2010]]></category>

		<guid isPermaLink="false">http://nuggets.comperiosearch.com/2011/03/prototyping-pipeline-stages-in-powershell/</guid>
		<description><![CDATA[The defacto way of creating a custom pipeline stage in FAST for SharePoint is to create an executable file which reads and writes an xml file. This usually implies having Visual Studio available and compiling and deploying a new file each time you make a change in order to test it in a proper pipeline. [...]]]></description>
				<content:encoded><![CDATA[<p>The defacto way of creating a custom pipeline stage in FAST for SharePoint is to create an executable file which reads and writes an xml file. This usually implies having Visual Studio available and compiling and deploying a new file each time you make a change in order to test it in a proper pipeline.</p>
<p>To the rescue comes PowerShell. Since all FAST servers have PowerShell installed you can create a PowerShell script and use this. All you need is notepad :) This gives the flexibility of trying out stuff without recompiling. But the cost is speed of execution. So you might want to port the code over to e.g. C# when you are done testing your code.</p>
<blockquote><p>See my post “<a href="http://techmikael.blogspot.com/2010/12/how-to-debug-and-log-fast-search.html" target="_blank">How To: Debug and log FAST Search pipeline extensibility stages in Visual Studio</a>” on how to do this in C#, and also how to create your own property set with PowerShell commands.</p></blockquote>
<p>In order to register the script in pipelineextensibility.xml we prepend the ps1 file with the PowerShell runtime</p>
<div id="codeSnippetWrapper">
<pre class="crayon-plain-tag">&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;Run&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;command&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe C:\FASTSearch\pipelinemodules\concept.ps1 %(input)s %(output)s&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;   &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;Input&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;           &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;CrawledProperty&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;propertySet&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;48385C54-CDFC-4E84-8117-C95B3CF8911C&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;varType&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;31&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;propertyName&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;docvector&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;/&amp;gt;&lt;/span&gt;   &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;Input&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;   &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;Output&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;CrawledProperty&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;propertySet&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;fa585f53-2679-48d9-976d-9ce62e7e19b7&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;varType&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;31&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;propertyName&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;concepts&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;/&amp;gt;&lt;/span&gt;   &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;Output&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;Run&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;</pre>
</div>
<p>In PowerShell you have the option to instantiate any .Net object, and for this script I use the XmlDocument class for xml creation out the result file. The script is pretty straight forward as it reads in an xml file. Selects a property called “docvector” and writes this out to a new field called “concepts”.  Typically you would do more work than just copy an attribute, but it shows the concept.</p>
<p>I’m not a PowerShell expert, so there might be better ways of doing some parts of this script. Make a note that I read and write the xml files with UTF-8 encoding. This is crucial as this is what the pipeline works with.</p>
<p><strong>concept.ps1</strong></p>
<p><strong> </strong></p><pre class="crayon-plain-tag">function CreateXml()
{
	param ([string]$set, [string]$name, [int]$type, $value)

	$resultXml = New-Object xml
	$doc = $resultXml.CreateElement(&quot;Document&quot;)

	$crawledProperty = $resultXml.CreateElement(&quot;CrawledProperty&quot;)
	$propSet = $resultXml.CreateAttribute(&quot;propertySet&quot;)
	$propSet.innerText = $set
	$propName = $resultXml.CreateAttribute(&quot;propertyName&quot;)
	$propName.innerText = $name
	$varType = $resultXml.CreateAttribute(&quot;varType&quot;)
	$varType.innerText = $type

	$crawledProperty.Attributes.Append($propSet) &amp;gt; $null
	$crawledProperty.Attributes.Append($propName) &amp;gt; $null
	$crawledProperty.Attributes.Append($varType) &amp;gt; $null

	$crawledProperty.innerText = $value

	$doc.AppendChild($crawledProperty) &amp;gt; $null
	$resultXml.AppendChild($doc) &amp;gt; $null
	$xmlDecl = $resultXml.CreateXmlDeclaration(&quot;1.0&quot;, &quot;UTF-8&quot;, &quot;&quot;)
	$el = $resultXml.psbase.DocumentElement
	$resultXml.InsertBefore($xmlDecl, $el) &amp;gt; $null

	return $resultXml
}

function DoWork()
{
	param ([string]$inputFile, [string]$outputFile)
	$propertyGroupIn = &quot;48385c54-cdfc-4e84-8117-c95b3cf8911c&quot; # FAST internal group
	$propertyNameIn = &quot;docvector&quot; # property name
	$dataTypeIn = 31 # integer

	$propertyGroupOut = &quot;fa585f53-2679-48d9-976d-9ce62e7e19b7&quot; # Custom group
	$propertyNameOut = &quot;concepts&quot; # property name
	$dataTypeOut = 31 # integer

	$xmldata = [xml][/xml][/xml]

(Get-Content $inputFile -Encoding UTF8) 	$node = $xmldata.Document.CrawledProperty | Where-Object {  $_.propertySet -eq $propertyGroupIn -and  $_.propertyName -eq $propertyNameIn -and $_.varType -eq $dataTypeIn } 	$data = $node.innerText  	# do your custom modification on $data here  	$resultXml = CreateXml $propertyGroupOut $propertyNameOut $dataTypeOut $data 	$resultXml.OuterXml | Out-File $outputFile -Encoding UTF8 } DoWork $args[0] $args[1]</pre><p>[Originally postet at <a href="http://techmikael.blogspot.com/2011/03/prototyping-pipeline-stages-in.html">http://techmikael.blogspot.com/2011/03/prototyping-pipeline-stages-in.html</a>]</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2011/03/02/prototyping-pipeline-stages-in-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the SharePoint Search &#8220;Best Bet&#8221; feature to redirect to a landing page</title>
		<link>http://blog.comperiosearch.com/blog/2011/02/19/using-the-sharepoint-search-best-bet-feature-to-redirect-to-a-landing-page/</link>
		<comments>http://blog.comperiosearch.com/blog/2011/02/19/using-the-sharepoint-search-best-bet-feature-to-redirect-to-a-landing-page/#comments</comments>
		<pubDate>Sat, 19 Feb 2011 11:14:00 +0000</pubDate>
		<dc:creator><![CDATA[Mikael Svenson]]></dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[fs4sp]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[sp2010]]></category>

		<guid isPermaLink="false">http://nuggets.comperiosearch.com/2011/03/using-the-sharepoint-search-best-bet-feature-to-redirect-to-a-landing-page/</guid>
		<description><![CDATA[[Cross-posted from Tech And Me] As described on TechNet: Best Bets are recommended results. Best Bets can link to recommended Web sites, data stores, and documents. When a user includes a keyword or one of its synonyms in a query, the search results page features links to its associated Best Bets in a prominent position. [...]]]></description>
				<content:encoded><![CDATA[<p>[Cross-posted from <a href="http://techmikael.blogspot.com/2011/01/using-sharepoint-search-best-bet.html" target="_blank">Tech And Me</a>]</p>
<p>As described on TechNet:</p>
<blockquote><p><strong>Best Bets</strong> are recommended results. Best Bets can link to recommended Web sites, data stores, and documents. When a user includes a keyword or one of its synonyms in a query, the search results page features links to its associated Best Bets in a prominent position.</p></blockquote>
<p>This can look something like this for the search term “search” on my sample site:</p>
<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2011/01/image5.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://blog.comperiosearch.com/wp-content/uploads/2011/01/image_thumb5.png" border="0" alt="image" width="504" height="251" /></a></p>
<p><span id="more-219"></span>In order to turn this into a landing page redirect we will change the uri scheme and edit the Best Bet web part xslt. By using this method you might see a quick flicker of the page before the redirect, but compared to the work involved it might be a small price to pay.</p>
<p>First we need to add a new Best Bet term. We do this by navigating to the site collection settings page where your search center site is hosted and choose “FAST Search keywords”. This should also work if you are not using FAST, but you have to choose “Search keywords” instead.</p>
<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2011/01/image6.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://blog.comperiosearch.com/wp-content/uploads/2011/01/image_thumb6.png" border="0" alt="image" width="344" height="124" /></a></p>
<p>Next click “Add Keywords”</p>
<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2011/01/image7.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://blog.comperiosearch.com/wp-content/uploads/2011/01/image_thumb7.png" border="0" alt="image" width="385" height="148" /></a></p>
<p>Enter your search term, in this example “search” and click OK.</p>
<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2011/01/image8.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://blog.comperiosearch.com/wp-content/uploads/2011/01/image_thumb8.png" border="0" alt="image" width="504" height="306" /></a></p>
<p>Hover your mouse over your search term, click the down arrow and select the “Add Best Bet” link. (Adding a Best Bet for regular search looks a bit different, but the procedure is more or less the same)</p>
<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2011/01/image9.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://blog.comperiosearch.com/wp-content/uploads/2011/01/image_thumb9.png" border="0" alt="image" width="351" height="311" /></a></p>
<p>Enter a title and note that I instead of “http”, enters “redirect” in front of the url</p>
<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2011/01/image10.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://blog.comperiosearch.com/wp-content/uploads/2011/01/image_thumb10.png" border="0" alt="image" width="504" height="333" /></a></p>
<p>Navigate to the search result page and enter edit mode. Next edit the Best Bet web part.</p>
<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2011/01/image11.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://blog.comperiosearch.com/wp-content/uploads/2011/01/image_thumb11.png" border="0" alt="image" width="504" height="263" /></a></p>
<p>Under “Data View Properties” open the XSL Editor. If you copy out the xsl you will around line 67 add the following code:</p><pre class="crayon-plain-tag">&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;xsl:if&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;test&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;substring($url,1,9) = 'redirect:' and $IsDesignMode = 'False'&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
         window.location = &lt;span class=&quot;str&quot;&gt;&quot;http:&amp;lt;xsl:value-of disable-output-escaping=&quot;&lt;/span&gt;yes&lt;span class=&quot;str&quot;&gt;&quot; select=&quot;&lt;/span&gt;srwrt:HtmlAttributeEncode(substring($url,10))&lt;span class=&quot;str&quot;&gt;&quot; /&amp;gt;&quot;&lt;/span&gt;;
    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;xsl:if&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;</pre><p><a href="http://blog.comperiosearch.com/wp-content/uploads/2011/01/image12.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://blog.comperiosearch.com/wp-content/uploads/2011/01/image_thumb12.png" border="0" alt="image" width="504" height="177" /></a></p>
<p>The added xsl will check for url’s starting with “redirect”, and use javascript to redirect to the actual url.</p>
<p>After saving the changes to the web part and the page, try to search for your defined best bet term, and you should be redirected.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2011/02/19/using-the-sharepoint-search-best-bet-feature-to-redirect-to-a-landing-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to: Frame a search center with little work</title>
		<link>http://blog.comperiosearch.com/blog/2011/01/27/how-to-frame-a-search-center-with-little-work/</link>
		<comments>http://blog.comperiosearch.com/blog/2011/01/27/how-to-frame-a-search-center-with-little-work/#comments</comments>
		<pubDate>Thu, 27 Jan 2011 13:05:00 +0000</pubDate>
		<dc:creator><![CDATA[Mikael Svenson]]></dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[sp2010]]></category>

		<guid isPermaLink="false">http://nuggets.comperiosearch.com/2011/01/how-to-frame-a-search-center-with-little-work/</guid>
		<description><![CDATA[Lately I have encountered several customs who deploy search from SharePoint 2010, but they still have other solutions running on MOSS 2007 or other portal frameworks. Instead of creating custom solutions using the search service on SharePoint 2010, framing is a quick solution to get you up and running. One way is to create a [...]]]></description>
				<content:encoded><![CDATA[<p>Lately I have encountered several customs who deploy search from SharePoint 2010, but they still have other solutions running on MOSS 2007 or other portal frameworks. Instead of creating custom solutions using the search service on SharePoint 2010, framing is a quick solution to get you up and running.</p>
<p>One way is to create a custom master page to replace v4.master for the search center, but this requires html knowledge and tinkering. In many cases it’s just as easy to go the configuration way.</p>
<h4>Hello IsDlg=1and s4-notdlg</h4>
<p>You have probably seen throughout SharePoint 2010 that it opens modal dialogs for different tasks. For example if you want to create a new site you get a dialog looking something like this</p>
<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2011/01/image2.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://blog.comperiosearch.com/wp-content/uploads/2011/01/image_thumb2.png" border="0" alt="image" width="644" height="348" /></a></p>
<p>The source for this page is loaded from /_layouts/AddGallery.aspx?<strong>IsDlg=1</strong></p>
<p>The part to note is the appending of IsDlg=1 which tells the page it is rendered in a modal dialog. In effect this will change some styles for the page which hides the ribbon and top menus based on the style sheet class s4-notdlg. (MSDN: <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.unsecuredlayoutspagebase.isdialogmode.aspx">http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.unsecuredlayoutspagebase.isdialogmode.aspx</a>).</p>
<p>In order for a page to frame in search they will merely append IsDlg=1 to the search center url.</p>
<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2011/01/image3.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://blog.comperiosearch.com/wp-content/uploads/2011/01/image_thumb3.png" border="0" alt="image" width="562" height="484" /></a></p>
<p>Unfortunately the IsDlg=1 parameter is not added automatically to all links. There are a couple of places we need to edit.</p>
<p>First off is the  Advanced link. Edit the search page and append IsDlg=1&amp; to the link</p>
<p><a href="http://blog.comperiosearch.com/wp-content/uploads/2011/01/image4.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://blog.comperiosearch.com/wp-content/uploads/2011/01/image_thumb4.png" border="0" alt="image" width="119" height="244" /></a></p>
<p>After saving switch over to the People search box and do the same edit for the people search result page.</p>
<p>In theory we could add ?IsDlg=1 to the result page link as well, but this won’t work as ?k=searchterm is added in front of it, and two question marks in the url messes up the parsing.</p>
<p>Instead we modify the xslt for the result pages by a small style sheet entry.</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<pre class="crayon-plain-tag">&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;xsl:text&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;disable-output-escaping&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;yes&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;!&lt;/span&gt;[CDATA[    &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;style&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;text/css&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;    .s4-notdlg { display: none !important }    &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;style&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;    ]]&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;xsl:text&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;</pre>
</div>
<p>This can be places below &lt;xsl:template match=&#8221;/&#8221;&gt;  at the end of the default xslt. Do the same for the xslt on the people search result page.</p>
<p>The caveat with setting the s4-notdlg style is that it will hide the ribbon menus regardless of the IsDlg query parameter. This leads us to have one search center for framing and one which is used natively in SharePoint 2010.</p>
<p>So the question remains, is it better to rely on IsDlg and s4-notdlg or should I go for a custom master page?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.comperiosearch.com/blog/2011/01/27/how-to-frame-a-search-center-with-little-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
