Thursday, August 28, 2014

PDF previews enabled in Office365 for search and document libraries

image

With the March 2013 PU SharePoint 2013 on-premises got this functionality as Office Web Apps added support to open PDF documents. Not a big surprise as Word itself can open PDF documents.

For on-premises you could for search results easily add a Result Type to allow for PDF previews, while for document libraries the best option is Wictor Wiléns farm solution which patches up, or my more ad-hoc solution as blogged at http://techmikael.blogspot.com/2013/06/enabling-pdf-previews-in-your-lists.html

Long ago this was also available in SharePoint Online, but it was removed at some point for unknown reasons – meaning they turned off the PDF support for the online WAC server. Good news is that they are back!

The updates themselves

For search it is the Item_PDF_HoverPael.html file which has been updated - _catalogs/masterpage/Display Templates/Search/Item_PDF_HoverPanel.html. Hopefully this update will find it’s way on-premises as well, or simply copy it from an online tenant locally.

For document libraries the filepreview.js file has been patched to support .pdf, same as Wictor and I have blogged about.

Tuesday, August 26, 2014

Limiting on types of file in SharePoint

There are two managed properties you might consider for limiting or refining on the types of files indexed in SharePoint. One is FileExtension, the other is FileType. The main difference is that FileType is based on the content inside the document, not the extension, while FileExtension merely strips of the file extension of the file name.

This means that if you have a text file named test.txt and rename it to text.xlsx, on the FileType refiner it will be sorted under txt, not xlsx.

My personal preference and SharePoint’s default behavior is to use FileType.

When it comes to Display Templates, SharePoint will by default use FileExtension. This means if you rename test.xlsx to test.docx, it will use an Icon for Word, but show a refiner for Excel – unless you override and change the behavior in your Display Templates that is.

image

Thursday, August 21, 2014

How To: Search up items which don’t have a value set

imageOne of the harder things in search is to search for something which don’t have a value set, and it sort of goes against how a search engine works. If an item is missing a value on a property, then this property is not set in the search index. It will be non-existent.

Using SQL you can use operators such as IsNull to return items which are missing a value, but using SharePoint search you don’t have this operator.

A common work around is to provide some dummy/default value, and you can filter on this one instead. But often this is not an option.

Tuesday, August 19, 2014

“Optimize for frequent use” setting in a Result Type

image

You have probably seen the check box for Optimize for frequent use if you have ever created a Result Type in SharePoint. But, what does this mean?

Saturday, August 9, 2014

S15E08–Query Rules – I am Trigger Happy (intent)

This is the eight episode in the series “SharePoint Search Queries Explained - The Series”. See the intro post for links to all episodes.

In this fourth episode around query rules, I am going to focus on capturing the intent of the user. What is the person searching really looking for? If you look at a random query log you can, more often than not, easily pick out queries which you could call “Q and A queries”. By “Q and A query” I mean a query which is meant to bring back an answer which you can take action on right away.

Wednesday, July 23, 2014

Gotcha on when a Query Rule Doesn’t Trigger

A small heads up if you are creating query rules, and you notice that they won’t trigger. If you include a KQL operator or wildcard as part of your query, the rule won’t trigger.

Consider the screenshots below where the first one shows the wiki block, and the rest don’t. And it doesn’t matter which triggering mechanism you choose, they won’t trigger.

Reading closely on the setup page this is expected behavior:

image

You can also test this using the SharePoint 2013 Query Tool or the Query Tool test feature on the Manage Query Rule settings page in SharePoint.

image

image

image

image

Tuesday, July 22, 2014

Custom Search Result Page Layout in SharePoint

You’re messing with the search result page and figure you need a new zone on the page for some cool web parts.

Being an avid SharePoint Designer fan as I am, you open up the site and copy _catalogs/masterpage/SearchResults.aspx to _catalogs/masterpage/SearchResults_custom.aspx. Then you add a new web part zone to the bottom of the page and save the layout.

Next you make the layout available on your site (Bing it) and create a new page based on the layout.

Boom! – Code blocks are not allowed

image

Turns out the fix is pretty easy as the file actually has code blocks in it.

image

Simply remove the <% %> parts which does conditional checks for the Ribbon being hidden if the user is in Browser mode (not Design, Catalog or Edit mode)

You can probably implement the check yourself in JSOM if needed, or simply show/hide the ribbon in all modes.

So, how come the default layout works with code blocks? Well.. SharePoint does whatever it wants with the default pages and can configure SharePoint to work as it pleases. Being an outsider you don’t have those powers.

Monday, July 21, 2014

Better Best Bets with Lists

imageBest Bets or Promoted results is a great way to give end-users the answer to their search query without the additional click to open a page or document to locate the precise information they were looking for. Bing and Google already have many examples of this if you for example look for weather information or currency conversion.
Head over to the Microsoft MVP Award Program Blog, and read more about how you can improve on SharePoint’s built-in solution!

Wednesday, July 9, 2014

July 2014 CU for SharePoint 2013 released–with a search feature long lost from 2010

You may now install custom PDF iFilters again, like the one from Foxit or Adobe! In SharePoint 2010 you could install any iFilter you wanted for text extraction and the most common to install was for PDF documents. With SharePoint 2013 this was replaced by an internal file handler instead, which could not be overridden.

With the July 2014 CU for SharePoint 2013, you can yet again install your custom PDF iFilter, or override any built-in handler to use the iFilter of your choice.

Friday, July 4, 2014

Mikael’s best practice for managing Managed Properties in SharePoint 2013/SPO–and how to deal with dates

I’ve had this on my mind for a while, but  Waldek Mastykarz post “Inconvenient Managed Properties and getting a list of all custom Managed Properties in SharePoint 2013” triggered me to share my thoughts.

To sum up Waldek’s posts, he shows a neat way to use PowerShell on-premises to filter out all non-system defined managed properties. The disadvantage is that the list will also include all managed properties auto generated from site columns. And you cannot use it for SharePoint Online.

One of the lacking points with the auto generated managed properties, is that they are of type text, even for date time values. If you want to filter on date ranges you need to use a managed property of type Date and Time which is sortable, and not a text property. As Waldek points out, the re-usable properties of RefinableDateXX are lacking as they return a string object and not a date object. They work for filtering, but in a Display Template they suck. This argument is used by Waldek to point out that you end up creating custom managed properties to deal with for example dates – and the argument is quite valid and not a bad one. Because Waldek is a pretty darn smart guy if you haven't noticed and his blog is certainly one to follow.

image