There is an easy way to show number of search hits in the refinement panel of standard SharePoint Search (not FAST).

  1. Edit the result page with refinement panel in search center
  2. Edit refinement panel web part
  3. Remove Option “Use Default Configuration”
  4. In “Refinement > Filter Category Definition” add to the “Category” in the XML the attribute ShowCounts=”Count”:<Category Title=”Result Type” Type=”Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator” ShowCounts=”Count”/>

    “Do not try to separate the XML with newlines, it will not work. The XML must be one single line!”

Other Refinement Tips & Tricks

Found on: MSDN Forum, thanks Xue-Mei Chang.

In order to display file name instead of document tile in search result, you should edit the search core results web part, please follow the steps below:

1. Go to your search service application >>> Metadata properties > make sure “IsDocument” property is set as “Allow this property to be used in scopes”; do a full crawl after this change.

2. Go to your search result page, edit the “search core results web part” >>> Display Properties:

3. Uncheck the “Use Location Visualization” option.

4. In the “Fetched Properties” box, add <Column Name=”Filename” /> element before the </Columns> tag.

5. Find the following block of code:
<a id=”{concat($currentId,’_Title’)}”>

<xsl:attribute name=”href”>

<xsl:value-of select=”$url”/>

</xsl:attribute>

<xsl:attribute name=”title”>

<xsl:value-of select=”title”/>

</xsl:attribute>

<xsl:choose>

6. Right after the <xsl:choose> tag, add

<xsl:when test=”isdocument = ‘True’”>

<xsl:value-of select=”filename”/>

</xsl:when>

——————————–

REMARK 7.5.2012:
If your filenames contains  äöü use the following code instead of the code 6):

<xsl:when test=”isdocument = ‘True’”>
<xsl:call-template name=”substring-after-last”>
<xsl:with-param name=”string” select=”$url” />
<xsl:with-param name=”delimiter” select=”‘/’” />
</xsl:call-template>
</xsl:when>

Place following Template before existing “<xsl:template name=”HitHighlighting”>”

<xsl:template name=”substring-after-last”>
<xsl:param name=”string” />
<xsl:param name=”delimiter” />
<xsl:choose>
<xsl:when test=”contains($string, $delimiter)”>
<xsl:call-template name=”substring-after-last”>
<xsl:with-param name=”string”
select=”substring-after($string, $delimiter)” />
<xsl:with-param name=”delimiter” select=”$delimiter” />
</xsl:call-template>
</xsl:when>
<xsl:otherwise><xsl:value-of select=”$string” /></xsl:otherwise>
</xsl:choose>
</xsl:template>

Do you recognize that in some case the search results of SharePoint 2010 display the first line of the office document instead of the title or the filename?

Here is the solution, found on Andy Dawson’s Blog. Thanks Andy.

  • Open registry editor on SharePoint Server
  • Navigate to HKLM\SOFTWARE\Microsoft\Office Server\14.0\Search\Global\Gathering Manager
  • Edit the ‘EnableOptimisticTitleOverride’ key and modify its value to 0 (DWORD)
  • Restart the SharePoint Server Search 14 service by starting an admin command prompt and issuing the following commands:
    • net stop osearch14
    • net start osearch14
  • Repeat the above steps for all SharePoint servers in the farm.
  • Perform a full crawl on the SharePoint content source(s)

When you try to sort the user profile properties, you get nuts.

Following you’ll find some PowerShell scripts to manage the sort order of the user profile properties

First of all you have to start the SharePoint 2010 Management Shell and add the SharePoint-Snapin:

Add-PsSnapin Microsoft.SharePoint.PowerShell

Be sure the user you are using has enough permission right to modify the user profiles. Otherwise you’ll get errors in the following steps.

To get the actual position of a user property, use the following PowerShell-Script:

Add-Type -Path “c:\program files\common files\microsoft shared\web server extensions\14\isapi\microsoft.office.server.dll”

$mySiteUrl = “http://<your mysite url>

$site = Get-SPSite $mySiteUrl

$context = Get-SPServiceContext $site

$upConfigManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager($context)

$profilePropertyManager = $upConfigManager.get_ProfilePropertyManager()

$upConfigManager.GetProperties().GetPropertyByName(“<Name of the property>“)

To get the actual position of a section, use the following PowerShell-Script:

Add-Type -Path “c:\program files\common files\microsoft shared\web server extensions\14\isapi\microsoft.office.server.dll”

$mySiteUrl = “http://<your mysite url>

$site = Get-SPSite $mySiteUrl

$context = Get-SPServiceContext $site

$upConfigManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager($context)

$profilePropertyManager = $upConfigManager.get_ProfilePropertyManager()

$upConfigManager.GetProperties().SetDisplayOrderByName(“<Name of the section>“,1,<New position number>)

To modify the actual position of a user property, use the following PowerShell-Script:

Add-Type -Path “c:\program files\common files\microsoft shared\web server extensions\14\isapi\microsoft.office.server.dll”

$mySiteUrl = “http://<your mysite url>

$site = Get-SPSite $mySiteUrl

$context = Get-SPServiceContext $site

$upConfigManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager($context)

$profilePropertyManager = $upConfigManager.get_ProfilePropertyManager()

$upConfigManager.GetProperties().SetDisplayOrderByPropertyName(<Name of the property>“,<New position number>)

$upConfigManager.GetProperties().CommitDisplayOrder()

To modify the actual position of a section, use the following PowerShell-Script:

Add-Type -Path “c:\program files\common files\microsoft shared\web server extensions\14\isapi\microsoft.office.server.dll”

$mySiteUrl = “http://<your mysite url>

$site = Get-SPSite $mySiteUrl

$context = Get-SPServiceContext $site

$upConfigManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager($context)

$profilePropertyManager = $upConfigManager.get_ProfilePropertyManager()

$upConfigManager.GetProperties().SetDisplayOrderByName(<Name of the section>“,1,<New position number>)

$upConfigManager.GetProperties().CommitDisplayOrder()

Hope that helps

Michael

Limitation Topic Thoughts / Findings
Deployment of Visual webparts There’s a solution by using Visual Studio 200 SharePoint Power Tools:

TimerJobs Not possible!

My Idea: Create a hidden list where each entry represents a timer job execution instance. The class name / assembly of the code to be executed as a timer job can be stored as meta data in that list.
A client service which has to be run on a server outside of SPO checks that list periodically using Client Object Model and updates “TimerJobs” items to raise an ItemUpdated event.
An event handler installed on that list executes then the timer job logic server-side.
Access to SPO from a client side service without user interaction for authentication:
Run Code In Elevated Mode No direct solution.

Recommendations found in internet are to intelligently define user permissions to avoid the need of elevated code (at least for some cases)
My approach would be to re-use the TimerJob concept from above. Limitation is that elevated code has to be run asynchronously.
Localization (Resource Files) Possible by adding the satellite assemblies to the solution package:

Service Locator Framework Possible, but extra effort required.

Check these instructions:
Business Connectivity Services Not available. Not possible to use
Hide Custom Action Not supported. Also not widely used feature.

Even no server side access to SPRibbon object to hide actions programmatically (due to unavailability of WebControls namespace)
Microsoft.SharePoint.WebControls and Microsoft.SharePoint.WebPartPages Namespace Not Available. Reason is not 100% clear – most likely because Microsoft had not the power to make them Sandbox compatible.

Major impact. Only way to use controls such like SPGridView when placing them onto pages using SharePoint Designer. Professional WebPart development is not possible.
As a consequence, Webparts have to implemented using SilverLight or with ASP.NET Forms but without the SharePoint controls.
Delegate Controls Not supported

To insert some javascript on every page follow this instruction:
To “register” a control one has to modify the masterpage, which isn’t very elegant.
Logging Logging to dev log (ULS Log) is not available.

Creating a hidden list with important log entries could be an alternative but has to be built.
Using the Logging mechansism from SharePointServiceLocator you can override two methods as described under:
The SharePointLogger class includes two virtual methods, WriteToOperationsLogSandbox and WriteSandboxTrace, which you can override to provide functionality to write to another location such as a SharePoint list if you are unable to install the full-trust proxy for logging.
Search Config (Managed Properties) Not available.
Application Pages Not supported because no files can be deployed to the file system.

There’s a workaround for that using a webpart, a module file where the webpart is placed into and the SPUserCodeWebPart wrapper:
Managed Metadata Generally available, but no programmatic access to taxonomy object model.
Server Side Redirect Not supported.

We used that quite often to i.e. bring up correct edit forms
Visual Studio Fully Programmed Workflows Not supported
Better Tag Cloud