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.

Monday, July 6, 2015

Introducing the CollaboGraph by Puzzlepart

Took me long enough, but I finally put the winning entry from “Battle of the Graph @ Ignite 2015” out in the store for everyone on Office 365. And of course, it’s free!

Search for CollaboGraph in the SharePoint Store and you should be able to add it in seconds.


Thursday, July 2, 2015

How to solve results from a result source is showing default results after import of a search schema

If you like me use CSOM to import search configuration xml files between environments in site collections you might run into an issue where after an import, all web parts or API calls using a custom Result Source suddenly show results from the default Local SharePoint Results result source instead of the custom one.

The search-is-down developer solution is to restart Search Host Controller on the query servers to make sure they are up to speed on result sources in your system. The better production search-is-up solution require you to open up each result source, click Save, and wait for 10-20 seconds for settings to go live. Both ways ensures search results will appear as expected again.


Monday, June 29, 2015

SharePoint 2013 Search Query Tool v2.4 released


I decided it was time to release v2.4  of the query tool this morning. No major changed, but some UI improvements to collapse Connection and Advanced boxed to leave more room for search settings (courtesy of Dan Göran Lunde). You can now also resize the window down to 800x600 for those using low resolution screens or remote desktop sessions.

Get your copy NOW!

Friday, June 26, 2015

See who has looked at your cool stuff

In this day and age where we create site collections instead of sub sites it’s quite easy to see who has taken an interest in your stuff.

Header over to and view the contents of the hidden User Information List. This list contains an entry for anyone who has ever visited your site.


And a shout out to Tobias Zimmergren and his trusty old post from 2008 covering this

Listing related articles–with added smartness

I got asked if I could spend a few hours helping with a related articles query for a client. And being such a nice guy I jumped at the chance, as I sort of knew what to do up front. Here’s the solution for your enjoyment.

Note: In order to implement the solution you need to know how site columns relate to automatic generated managed properties. Being familiar with JSOM and HTML is also helpful.
Say you have an article page in SharePoint which is tagged from the following term sets
  • Topic
    • News
      • Sports
      • Finance
    • Editorial
      • Analysis
      • Report
  • Audience
    • Novice
    • Intermediate
    • Pro
  • Classification
    • Internal
    • External
    • Go Dark
When you view a page tagged with Topic:Finance, you want to list other pages tagged with the same term. Looking at sample 2 in Query Variables – Constant Trouble I would use the following query in a content search web part to achieve this
owstaxIdTopic:{ListItem.Category.IDWithChildren} ListID:{List.ID} -ListItemID:{ListItem.ID}

Wednesday, June 24, 2015

Video Embed is here! (for first release)

As with all tech following in other footsteps we all cheer when a new feature which should have been there from the start appear. Now in first release tenants in Office 365 you can get an embed code for your videos stored in Office Video.
[Support link about embed] [Get embed code via REST]

Click the Embed link, copy the embed code, and paste it into a page in SharePoint.


NOTE: The new blog experience via the Delve profile page already support using video’s from Office Video by pasting the URL for a video directly, so no need to use embed code.