Friday, May 22, 2015

Pre-Ignite Hackathon Report


January 2nd and 3rd, Saturday and Sunday before Microsoft Ignite sported a hackathon organized by Andrew Clark. Being a hacking kind of guy I joined up together with Chris Givens, Shannon Bray and my colleague Espen Olsen (who bailed on us on Sunday).

The task was to pick one of five community problems and use Office 365 and/or Azure to solve it in 24h. Coming straight from an over seas flight my mind was playing tricks on me, but we chose problem #4.


Why BYODs and Office 365 Will Make More Money for Your Company



Before Office 365 really took off, employees had access to e-mail on their mobile phones. Access to e-mail on a personal device allowed them to review and respond to off hours requests. An action usually done on the employees own time and conscience. This means employees are giving away hours for free, which is a good thing if you’re an employer, right? But the flip side is that an e-mail feels like something you HAVE to respond to; it’s not learning.

Monday, May 18, 2015

ALWAYS set the client type on SharePoint search API calls–and be smart about the value

At my current customer we recently deployed SharePoint 2013 search, but we don’t seem to get any search suggestions in the search box, thus search-as-you-type in the search box never show anything.

Before diving into the reason behind it all, the solution is to add &clienttype=ContentSearchRegular to all search REST/API calls where you know you will do custom rendering of the result and have no intention to implement the RecordPageClick event when users click on of the result items.

Tuesday, April 28, 2015

How to run code after all CSWP’s have finished

My colleague Gissur at Puzzlepart asked me if I knew how he could run some piece of JavaScript after all his CSWP’s were done rendering. He has 19 WP’s on the page all collapsed by default with CSS, and wanted the first one with content to be expanded upon page load.

He could have gone the content routing approach which I’ve blogged about previously, but as he has paging per web part, that would not work.

Thursday, April 23, 2015

Restarting your Search Host Controller will impact People Search

We’ve had issues with people search not working in two environments which was solved by adding the search service account to the WSS_ADMIN_WPG local group on all search servers. The issue is that if the search service account is not part of this group it cannot read the projection model files needed to perform fuzzy name search.

You can read more about this issue over at Ron Grzywacz’s blog.

Tuesday, April 14, 2015

An approach to list all external users in your SharePoint Online enviroment


Kirk Liemohn recently asked a question on the Office 365 Yammer network if there was an API to list all the external users on his tenant. Being the search guy I am, I suggested using the search API to do this.

Friday, April 10, 2015

Improving contextual Search in SharePoint Online / 2013

In April 2014 my Puzzlepart colleague Tarjei “The strongest man in SharePoint” Ormest√łyl had a post about how to configure search settings for a site to redirect scope searches over to your search center instead of osssearchresults.aspx. (This would be the “search in this site” search box you find in sites.)
In my recent project we have implemented the same logic as we want scope searches in SharePoint 2010 to be sent over to the new 2013 farm.

I have improved on Tarjei’s solution with the following points:
  • Display title of the site instead of just the URL (or list title as we support 2010 redirects to 2013 search)
  • Implement as a generic script to be added anywhere on the page – preferably in the control template, but for this post I’ll do it as a script web part.
If you look at the code I’m using a neat trick to get the DataProvider for the page and also hook in my logic after the results are ready the first time to fire off my custom scope hint code.

// Get a reference to the DataProvider for the page
var dp = Srch.ScriptApplicationManager.get_current().queryGroups.Default.dataProvider;
// Add event to be called after results are ready

Sunday, April 5, 2015

Why content types are still awesome and useful–despite what the cool guys says

This post is about explaining why you don’t need to be concerned about custom web template id’s in search and how to maintain metadata for a site (root web or sub web). In this new world of SharePoint Online we’re only using built-in web templates and derivatives of them right?

A lot of search queries use the contentclass:sts_site webtemplate:templatename construct to limit results only to root sites of a special site type (or sts_web for sub-sites). Living in SharePoint Online most sites will build of a blank or team site, and using the new provisioning engine from Office PnP, this becomes an issue for many. You can use the engine to save a template definition xml file, and create new ones off it, but how do you distinguish sites from one another?

Tuesday, March 31, 2015

Speaking at Ignite on Office Graph and Office Video

I’m really honored to be allowed to speak at the biggest SharePoint event for the third time in a row. Previously it was Microsoft SharePoint Conference, now it’s Microsoft Ignite!

Previously I’ve spoken on extending people search and search relevance, and this time I’ve been allowed back for two sessions. One on Office Graph and one on Office 365 Video. Both related to search in their own ways.

If you haven’t signed up for this all encompassing event which covers most of the tech Microsoft has to offer, head over to and book May 4-8, 2015 in Chicago in your calendar today!

Thursday, March 19, 2015

Why you (as an HTML developer) should start to think of the DOM as a travelling salesman problem

I stumbled upon the following jQuery code by another team member (not a Pzl guys as we know better). I challenged him to figure out what was “wrong” with it and he did sort of clue himself in so I’m not outing him here :)

function showMoreButton(className) {
   var alteringDiv = $(className);
   if (!$.isEmptyObject(alteringDiv)) {
       //DOM changes to Search Navigation
       alteringDiv.prepend('<h2 class="ms-displayInline moreButton"></h2>');
       $('.moreButton>a').attr('id', 'moreSearchCategories').addClass('collapsed');