Wednesday, August 26, 2015

“Failed to start the flow” error when importing dictionaries in SharePoint 2013 search

During a production deployment today we encountered the following error when running the Import-SPEnterpriseSearchCustomExtractionDictionary commandlet for a custom dictionary.

Importing \\dropserver\deployment$\Internal\dictionaries\site_types.csv to Microsoft.UserDictionaries.EntityExtraction.Custom.WordPart.3
Import-SPEnterpriseSearchCustomExtractionDictionary : Failed to start the flow: Microsoft.CXDDeploymentCaseInSensitive

There were no apparent reason for this and if it had been a test environment we would have just re-started the Search Host Controller service on all machines and hope that it fixed it. As we were in production that was not an option.

Tuesday, August 25, 2015

Delve blog articles dissected

Kanwal Khipple had a question on the Office 356 Yammer network the other day about how can you surface Delve blog articles on a SharePoint site?

To figure out if it’s doable and how you need to understand how the Delve article solution is built. I won’t go into the actual digging, but rather lay out the building blocks from a technical perspective.
And if you want the short story, surfacing metadata other than Title and Author is not trivial – from a search perspective. Which is also what you see in a Delve card.


Wednesday, August 19, 2015

How to do case-insensitive sorting in SharePoint search

Short answer, you can’t.


If you’re working on-premises, read on for the longer answer. If you’re working in SharePoint Online, take a deep breath, sigh, and log a support ticket so we can get this into the product.

Tuesday, August 18, 2015

Changing JSON properties in an XML file–or edit DataProviderJSON in a search web part using C#

I have previously posted how to use PowerShell to change properties for a search result web part (Make sure your people search is fuzzified)

My colleague Tarjei (@tarjeieo) is working on some templating for a provisioning engine using CSOM and he needed to change some values in a web part file before loading it into a page. This involves both XML parsing with namespaces and making sure you don’t cripple the JSON object you are changing.

Here’s the code I ended up with to modify the SourceName property for a search result web part file, ignoring the namespaces in the xml file.

XElement doc = XElement.Load(@"D:\Temp\test.webpart");
var element = doc.XPathSelectElement(".//*[local-name() = 'property' and @name='DataProviderJSON']");
dynamic dp = JObject.Parse(element.Value);
dp.SourceName = "lala";
element.Value = JObject.FromObject(dp).ToString();

Saturday, August 8, 2015

Fall Speaking Schedule– Modern Workplace Summit, SPS Münich and SPS Oslo


8-9 September sports the Model Workplace Summit hosted in Oslo with tracks on Office 365, Skype for business, Windows 10 and business productivity, and I’m delighted to announce that I was chosen to speak at the first Modern Workplace Summit ever.

If you need to create a strategy for collaboration, cloud, migration, or how to increase end user adoption then this is the conference for you to participate. Take a look at the impressive speaker line-up, and even more impressive agenda with over 50 sessions for you to choose from. Register at

My session is titled Office 365, SharePoint Online, SharePoint On-premises - The Hybrid story and beyond, and in the session I will discuss the hybrid story so far, and the road ahead from Microsoft. I will weigh pro's and con's about being on-premises only, online only, or maybe hybrid can be the winning solution?


October 10th I’ll travel to attend the inaugural SPS Münich. The conference is organized by my good friend Matthias Einig and I’m honored to be asked to speak. I will do my Search Queries Explained talk based on my blog post series and book, as it seems to be a topic never exhausted and a topic dear to my heart.

SPS Oslo

October 17th it’s my home town of Oslo which will have it’s third SharePoint Saturday. I was part of organizing the first two, but the event is in good hands!

In Oslo I’ll talk about Office Graph - Is it for you and your business? where I will go into what the Office Graph is and how it can play an important part for information retrieval and insights in your business.

Hope to see you at any of these three events and they should all be pretty fun and interesting!

Sunday, August 2, 2015

Importing managed properties and search settings to your SharePoint Online tenant is dead easy!

The crux to get this working is to set the client context to your sharepoint admin site and use the SPSiteSubscription level for your import.

string adminUrl = "";
using (var context = new ClientContext(adminUrl))
    context.Credentials = new SharePointOnlineCredentials(userName, securePassword);
    SearchConfigurationPortability searchConfig = new SearchConfigurationPortability(context);
    SearchObjectOwner owner = new SearchObjectOwner(context, SearchObjectLevel.SPSiteSubscription);
    string xml = System.IO.File.ReadAllText("SearchConfiguration.xml");
    searchConfig.ImportSearchConfiguration(owner, xml);

If you are using OfficePnP then you get away with the following snippet

string adminUrl = "";
using (var context = new ClientContext(adminUrl))
    context.Credentials = new SharePointOnlineCredentials(userName, securePassword);
    context.ImportSearchSettings("SearchConfiguration.xml", SearchObjectLevel.SPSiteSubscription);

Wednesday, July 29, 2015

How to do a light weight search center using osssearchresults.aspx (part 3/3)

In the two previous posts I showed how to change the scopes shown in the search drop-down boxes as well as how to modify what is shown on the search page itself using JavaScript injection.

Next up is changing what data is shown on the result page itself. When you do a wildcard search using * you get all kinds of items on the osssearchresults.aspx page. One common ask is to remove container type items like views and folders. On a search center we would either change the web part query template itself or target it using a custom result source to accomplish the filtering.

Tuesday, July 21, 2015

How to do a light weight search center using osssearchresults.aspx (part 2/3)

In the first post I went over how to change the default scopes available in the search box drop-downs to ensure we stay within the site and osssearchresults.aspx.

Next up is modifying the UI and hide unwanted controls.

Topics covered in this post:
  • Script injection on osssearchresults.aspx
  • Modify search controls via JSOM at the right place in the page life cycle

Friday, July 17, 2015

How to do a light weight search center using osssearchresults.aspx (part 1/3)

Most times these days the Team Site template is the starting point for any site template I create. At my current project we are creating a template for sites to be used by external users. For this particular SharePoint farm we don’t have a search center set up, as the search center is only available to internal users on the internal farm – a full-on center with custom branding etc.

At the moment we decided to go with using the default result page osssearchresults.aspx per site (site collection), to allow search within the site. Which is all out of the box.

But, we do want some customizations to the search page, which we cannot easily do as osssearchresults.aspx is a layouts page and you cannot edit the web parts. Which brings us to the meat of this post. How do you go about customizing the controls on the osssearchresults.aspx page when you can’t edit it?

Tuesday, July 14, 2015

SharePoint REST do support Query variables!


From my list at you can use the following variables in a REST query:

  • Site
  • SiteCollection
  • URLToken
  • Request (not useful as it return _vti_bin/client.svc)
  • User
  • Today
  • SearchBoxQuery
  • CurrentDisplayLanguage
  • CurrentDisplayLCID

Basically all which does not pull in a value from a specific context item.


Fill in your variables in the “Query Template” field of the SharePoint 2013 Query Tool and you get the syntax. Get the code and compile yourself and you will see the final expansion as well.