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.