Monday, December 30, 2013

SharePoint 2013 Ceres Shell – down the search rabbit hole

When preparing for the BIWUG Session – Everything you always wanted to know about SharePoint Search Relevance  I came across a number of blog posts about the Ceres shell. For those of you interested about the inner workings of SharePoint search, keep on reading.

The Ceres shell is a set of PowerShell cmdlets which allow you to control the internal workings of SharePoint Server 2013 search. It is a remnant of the FAST search engine which provided a set of very powerful tools to tweak the search engine inner working (but also to completely tear down you search :-)) and which is now integrated in SharePoint Server 2013.

As Christoffer Vig outlined in his blog post Making synonyms visible in SharePoint 2013 search results  modifying the settings in the Ceres engine can completely ruin your SharePoint install, so be careful and I’m not really sure if modifications are even supported.
In this post we will explore how the different content processing pipeline components work using the Ceres shell. The Ceres shell script is located underneath C:\Program Files\Microsoft Office Servers\15.0\Search\Scripts\ceresshell.ps1.  The script listed below allows you to connect to Ceres engine and list all the different flows.
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
& "C:\Program Files\microsoft office servers\15.0\search\Scripts\ceresshell.ps1"
Connect-System -Uri (Get-SPEnterpriseSearchServiceApplication).SystemManagerLocations[0] -ServiceIdentity hpw\spfarm
Connect-Engine
Get-Flow



To look at the configuration of one specific flow you can specify the flow name as a  parameter.

Get-Flow Microsoft.MetadataExtractorSubFlow



One of the things I had been struggling with in SharePoint 2013 is the title field which is shown in the search results. By default SharePoint 2013 contains a mechanism which will override the title managed search property with some extracted text from PowerPoint and Word documents – this is similar to the EnableOptimisticTitleOverride functionality in SharePoint 2010. The Microsoft.MetadataExtractorSubFlow.dll contains some mechanism which determines that the some line of text in a header of a document is a more suitable title for the document and overwrites all of your other properties (The title filled in the Word document properties or the title in SharePoint, etc…). However, this does not always work as expected.

If you look at the flow details, you will see that extractedTitleField maps onto the Title managed search property and that the Author and LastModifiedTime fields use the same mechanism.



I guess that if you update this flow in a similar fashion as here Making synonyms visible in SharePoint 2013 search results you will be able to display the metadataextraction but I think there is a better way to do this after installing the SharePoint Server 2013 October 2013 Cumulative Update  - stay tuned for another update on this in a next  blog post.

If you have found great blog posts or other uses of the Ceres engine – please leave a comment.

 References:

Tuesday, December 24, 2013

Changing social e-mail notification settings in SharePoint 2013 using the SharePoint server object model

I recently got the question whether it was possible to change the e-mail notification settings from the newsfeed functionality in SharePoint 2013 for all users – for those of you who don’t know this functionality check out Get email notifications about newsfeed items. Out of the box you will get a lot of e-mails for different actions on your newsfeed such as when someone has started following you, mentions, replies to conversations or community discusion posts, etc …

It actually is a UserProfile property called EmailOptin which controls this behavior but unfortunately there is not a lot of documentation about this property. The property contains an integer value that you need to set – the logic seems to be a bit strange but you need to set the value of the bit to 1 if you want the checkbox to be unchecked – the next example shows if you only want to

  Integer value to uncheck
Someone has started following me 2
Suggestions for people and keywords I might be interested in 4
Someone has mentioned me 8
Someone has replied to a conversation that I started 16
Somone replied to a conversation that I replied to 32
Someone replied to my community discussion post 64
 

This means that if you only want to uncheck the first option (Someone has started following me) you need to set it SPS-EmailOptin to 2. Listed below is a code sample for a console app which runs on the SharePoint server and which sets the SPS-EmailOptin property.

 
   1:  using System;
   2:  using System.Collections.Generic;
   3:  using System.Linq;
   4:  using System.Text;
   5:  using System.Threading.Tasks;
   6:  using Microsoft.SharePoint;
   7:  using Microsoft.Office.Server.UserProfiles;
   8:   
   9:  namespace UserProfilesServerOM
  10:  {
  11:      class Program
  12:      {
  13:          static string strUrl = "http://portal.hpw.local";
  14:          static string strAccount = @"hpw\joris";
  15:   
  16:          static void Main(string[] args)
  17:          {
  18:              
  19:              // Get SPSite and service context from string 
  20:              SPSite site = new SPSite(strUrl);
  21:              SPServiceContext serviceContext = SPServiceContext.GetContext(site);
  22:              
  23:              // Initialize user profile config manager object 
  24:              UserProfileManager upm = new UserProfileManager(serviceContext);
  25:              
  26:              
  27:              //To set prop values on user profile 
  28:              UserProfile u = upm.GetUserProfile(strAccount);
  29:              string sPropName = "SPS-EmailOptin";
  30:              //126 unchecks all options
  31:              u[sPropName].Value = 2;
  32:              u.Commit();
  33:   
  34:              Console.WriteLine("Hit any key to continue...");
  35:              Console.ReadLine();
  36:          }
  37:      }
  38:  }



Thursday, December 19, 2013

SharePoint 2013 search relevance session at BIWUG - December 2013

Presentation about search relevance at BIWUG (www.biwug.be) on the 18th of December - inspired and largely based on a session at SharePoint Conference 2012 in Las Vegas - check out the SPC145 Optimize Search Relevance in SharePoint 2013 video on Channel 9.

Tuesday, December 10, 2013

BIWUG session – SharePoint Apps and everything you always wanted to know about search relevance

On December 18th, BIWUG (www.biwug.be) is organizing another session about SharePoint apps as well as a deep dive session on SharePoint 2013 search – don’t forget to register for BIWUG1812.

Agenda:

  • 18:00 - 18:30 ... Welcome and snacks
  • 18:30 - 19:30 ... SharePoint Apps voor Developers  ( Speaker: Peter Plessers )

Samen met SharePoint 2013 werd ook het nieuwe App model geïntroduceerd die ons ontzettend veel mogelijkheden geeft voor het ontwikkelen van complexe business toepassingen voor zowel SharePoint Online als SharePoint On-Premise. In deze sessie gaan we aan de hand van een real-life toepassing in op een aantal onderwerpen die je kunnen helpen bij het ontwikkelen van SharePoint Apps.

De volgende onderwerpen komen aan bod:

• User & App authentication

• Integration between SharePoint & Windows Azure

• Using search and user profiles in your app

• App parts.

  • 19:30 - 19:45 ... Break
  • 19:45 - 20:45 ... Everything you always wanted to know about  ... ( Speaker: Joris Poelmans )

Search in SharePoint 2013 provides a comprehensive set of tools to manage search relevance. One of key enhancements is the introduction of query rules, that allow administrators to control relevance for a single query or sets of queries using a straightforward user interface. In this session, we will learn how ranking works under the hood, and give hands on demonstrations of how to use query rules, result sources, XRANK, federation to external search providers and the rank tuning tool to improve your relevance. We will see which tools are most appropriate for a situation and look at how you should approach search projects.

  • 20:45 - …      ... SharePint!