Wednesday, January 30, 2013

Continuous crawl - What is it, and what is it not

There's a lot of confusion around the new "Continuous crawl" mode in SharePoint 2013. It took me a while to decipher what it was myself, and reading the documentation on TechNet is not too helpful.

Let's break it down!

Continuous crawl is

  • only for SharePoint content
  • running non-blocking incremental crawls at 15 minute intervals (can be changed using PowerShell)
Continuous crawl is not
  • event based push indexing
If you run scheduled incremental/full crawls as in 2010, then each crawl is blocking. This means that if a crawl run takes longer than the interval set, then the next crawl will have to wait until the running one finishes.

When you enable continuous crawl, a new incremental crawl will start regardless of any running crawls (it will stil obey crawler impact rules).

The best example to illustrate the advantage of continuous crawls is if you start a full crawl of lots and lots of content which takes weeks to complete. During those weeks, all new content changes will be backed up until the running crawl completes. Using continuous crawl mode, it will still take weeks to process all the initial content, but any change happening during indexing will be picked up by new incremental crawls.

Result: New content is made searchable very fast regardless of other long crawls!

An excellent in-depth writeup on the topic can be found at the SharePoint IT Pro Blog, and is worth the read.

Wednesday, January 9, 2013

How to get thumbs to work with FS4SP when using Claims security in SharePoint

As stated in the Microsoft support article KB2554903 and KB2641517, document thumbnails with FS4SP and Claims based Authentication is not supported. There are also numerous threads on the Microsoft FS4SP forum about this.

I recently experiences this myself in a project and decided to fix it, because the fix is not really that hard. The issue is that when your browser calls http://server/_vti_bin/WACProxy.ashx it receives a 401 error due to it not handling claims.

A WSP for this solution can be downloaded from Codeplex. Note that the WSP will overwrite the existing WACProxy.ashx file, so you might want to create a copy of it first.

What I did was create a wrapper which calls the WACProxy running under elevated privileges instead, and switched out the existing WACProxy.ashx file with one pointing to my assembly.

using System.Web;
using Microsoft.SharePoint;

namespace mAdcOW.SharePoint
{
    public class WACProxy : IHttpHandler
    {
        public void ProcessRequest(HttpContext context)
        {
            SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                var proxy = new Microsoft.Office.Server.Search.Extended.Query.Internal.UI.WACProxy();
                proxy.ProcessRequest(context);
            });

        }

        public bool IsReusable
        {
            get { return false; }
        }
    }
}


You might thing it’s very very bad running this in an elevated security context and thinking this might create a security hole. But it won’t. What the WACProxy does is sending back script which points to for example http://server/library/_layouts/MobilePageHandler.ashx. This call is then being executed by your browser using your logged in credentials. This means if you don’t have access to the document, you can’t generated a thumbnail for it either.

So we are merely running the call to generate the proper thumbnail URL in an elevated context to get around the claims error.

If you do not want to overwrite or replace the current WACProxy.ashx file, I have a webpart you can drop on the search page which will redirect calls to WACProxy.ashx to YourWACProxy.ash file instead. I will commit this to spsearchparts.codeplex.com at a later time.

Friday, January 4, 2013

Searching All items in Outlook 2013

I updated to Office 2013 not long ago and when I searching for old items they do not appear, but instead at the bottom of the search result it displays:

Showing recent results...

More

First I though this was some setting with the indexing in Windows 8 but Outlook was selected as a source. Then I stumbled upon a support article “Only a subset of your Exchange mailbox items are synchronized in Outlook 2013” which solved my issue. The setting also applies to Calendar, Contacts, Tasks, Journal and Notes items.

By default with Outlook 2013 and using Cached Exchange Mode only the past 12 months are synchronized. Changing this to “All” fixed the issue and I can now search all my items offline and quickly.

image

The above support article lists the steps on how to change how much to cache locally.