Augment Search Result Pages with Filtered Document Library / List Views - SharePoint Zen - ROXORITY ™ Sensational SharePoint Solutions
User Voices
(Loading...)
Our blog on SharePoint add-ons and solutions development
« Print-Friendly SharePoint Calendar / List Views & User Profiles Web Parts | Main | Lost Web Part Connections on SharePoint 2010 List View Pages (Windows 7) »
Monday
Aug232010

Augment Search Result Pages with Filtered Document Library / List Views

While SharePoint's Search features present a great deal of configurability and customizability, it sometimes cannot be tweaked enough to support every need. We received the following request:

We have a WSS 3.0 store of documents that we would like to share. They are stored as list items and there are a number of different columns which help describe the documents. Some are quite straightforward, such as document name, document description, division and subdivision within the organisation that created the document. The one that is causing problems is a column called keywords. It takes its values from another list (sample values might be: climate change, air quality, litter prevention, noise pollution control). Since a document might be relevant to a number of areas, multiple keywords can be selected. I found that once multiple selections were allowed, a search scope allowing the user to narrow their search by keyword just wouldn't work. I would like to allow a user to narrow their search by organisational division, which I have done, and I'd like to be able to give them good functionality to filter the results that are returned. The filtering wouldn't just be limited to the keywords; it would also allow users to filter by date and author.

Now, we have experimented a great deal with the Search Core Results Web Part and found multiple issues, among them the fact that there seems to be no sane (working) way to connect any Filter provider web part to it at all, including not just FilterZen but also the out-of-box ones just the same. From an infrastructural point of view it seems that the Search Core Results web part does offer connectivity but under the hood it just inherits this functionality from the Data View Web Part in-disguise that it really is, yet seems to fully ignore incoming filters. It either shows all results or none at all, depending on connection type and provider Web Part. (By the way, when we went into 2010 to see whether this has improved, we realized that rather than fixing Web Part connectivity, MS has now been completely disabled connections in the UI for this.)

Were we able to overcome this issue, the next one would be the very limited set of filters that can be set for Search Core Results (which can be viewed via SharePoint Designer). Were this a simple List View Web Part or a filterable Content Query Web Part, you could filter by your Keywords column just fine, but with Search Core Results you are limited to title, author, size, sitename, url, description and a few other fields strictly related to the nature of "search results" rather than "list data" or "document properties".

As such, I would suggest that utilizing FilterZen to narrow down out-of-box Search Core Results listings on out-of-box Search Center result pages directly is not feasible at present. But: you could still augment the findability experience greatly if you were to connect FilterZen either directly to the List (if all the relevant documents are in just one List or Document Library) or (on SharePoint Server) to a CQWP = Content Query Web Part (if these documents exist in multiple Lists but share similar columns such as keywords, organizational division, author and date). This is actually how many of our users successfully implemented FilterZen — they added the "search interface" directly to their Lists or to a separate Web Part page together with their Lists or CQWPs, rather than trying to shove their custom line-of-business columns into the out-of-box search experience. If you think your end users could work with that, you might want to give this alternative consideration some pondering. If you would like to integrate directly into the built-in search (results) experience, a hybrid solution could be to have the List View or CQWP directly on your search results page with a Filter Web Part grabbing the user query from the 'k' URL parameter, pre-filtering the List View or CQWP (that could be called for example "Document Results") and letting users further drill down with additional interactive filter controls in the same Web Part for multiple selection of keywords, plus author and date pickers.

Here's a brief visual walk-through for such a hybrid approach:

First off, add both the Filter Web Part and your target List View, Document Library View or our connection-filterable Content-by-Query Web Part to your Search Results page, then connect the two Web Parts:

Next, create all the filters you want your users to interactively manipulate to further narrow the results they will be getting (if you're new to FilterZen, read the documentation's introductory topics and experiment on a separate temporary Web Part page for a few minutes) — that is, all the filters not directly depending on the current search query, such as your keyword or other metadata-driven choice and lookup filters, author and date pickers:

Enable the CAML Direct filtering mode:

Add an additional URL / Page Request Filter: this is named based on the name of the column that should be the targeted with the user's original search query. In Lists, this may often be Title; in document libraries, this could be the document name, document title or some other column. (To find the right column name, click the Filtering List Data? link at the top and use the tool that pops up.)

More importantly, set the filter operator to contains (expand the Advanced Filter Properties section for that). After scrolling back up to the URL / Page Request Filter Properties section, set the request parameter option to k, the name of the URL parameter that captures the current user search query in SharePoint:

This pre-filters your List View according to the current user search query, with the additional interactive filter controls letting users further narrow the List "results" and drill down until they find what they were looking for:

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.
Member Account Required
You must have a member account on this website in order to post comments. Log in to your account to enable posting.