Getting Started with the SharePoint Column Filtered Search Web Part

This is a simple walkthrough of how to set up SharePoint Column Filtered Search. For more structured documentation, see the Users Guide.

The web part needs to have a document library (or libraries) selected before it can be used. Then, some columns are chosen to present to the end-user as choices. The end user will select a value or multiple values from each column to filter the search results by. This effectively limits the search to only documents which match the user's requirements (without requiring any additional administration).

When the web part is first added to a page (or when the library/libraries haven't been selected yet) the user will be prompted to enter setup mode. This is the same as selecting "Modify Shared Web Part" from the dropdown menu, and a link is provided to simplify the process as follows:


The editor panel opens up on the right of the page and consists of a number of group boxes which are specific to the SharePoint Column Filtered Search, followed by the standard web part configuration options such as Appearance (where the display title of the web part can be set, for example) and Layout.

The group boxes specific to this web part are:
  1. Libraries
    • Select which document libraries to configure for the web part.
  2. Columns
    • Choose which columns from those libraries should be presented to the user
  3. Search Columns
    • Any column whose value should also be searched for occurances of the search term.
  4. Search Options
    • Options related to the search itself, or what to display with the search results
  5. Web Part Display Options
    • Options related to how the web part appears on the page (colour, style etc)


The first group box is Libraries. Here you should see two list boxes - one labelled Available Libraries and the other labelled Selected Libraries. Simply select the required library and click on the green arrow to move it from Available to Selected. To unselect a library, select it in the Selected Libraries list and use the red arrow to move it back to Available.


Note that whenever you have made a change to the configuration settings, you can click "Apply" to see the effect of your change on the web part without leaving the "Modify Shared Web Part" menu. Clicking "OK" will apply your changes and leave the edit view of the page.


Once the library has been selected, the Available Columns listbox will be populated in the next group box (Columns) as follows:


The columns which are made available for filtering are the non-system columns - these are columns that the site owner has permission to delete if desired. Again, select the appropriate column(s) and move from Available to Selected using the up/down arrows.


The next section is Search Columns. This is a little different to the columns required to filter on, and can include system columns. The columns that are available for searching on are those columns whose type is single line of text and which appear in the default view of the library. If you require a column to be included in the searched columns and it doesn't seem to be available, then you may need to add it to the default view of your library. Note you can remove it again after you set up the web part if you don't want it to appear in the default library view.

Again, move the required columns from Available to Selected as before.


The next set of options is labelled Search Options and affects the search results and how they are presented, as follows:


The options are as follows:

A. Show link to parent library
  • This will display a link to the parent library (default view) under the search result. With the standard OOTB (Out Of The Box) search, the only way to achieve a similar effect (jumping to the containing library for your search hit) is to copy the link and paste it into the browser's address bar, editing it to remove the document itself before hitting enter - a somewhat long-winded process, and not very intuitive for the end user.

B. Filter library link by matching column values
  • If, say, your columns to filter on contain one for Location, and the search hit of interest matches the selected Location value of London, then by selecting this option, the link to the parent library will take you to the document library and only show documents where Location=London. If you are filtering on multiple columns, then this will filter each column accordingly - effectively showing the user other similar documents from the library.

C. Display matched columnn filter values
  • This will have the effect of displaying beneath the search result each of the matching column values. Of course, if the user will only ever want to filter by one column value at a time, then this doesn't offer any additional information (the matched value will simply be the selected column value in the web part). However, the user may wish to see all matching documents which match one of several locations - such as London, Paris, New York, Munich (everybody talk about, pop music.). In this case, with multiple selections for a column, the user probably does want to know which Location any particular search hit matched.

D. Display hits in Search Columns
  • If the search result has a hit in the value of one or more of the selected Search Columns, this option will display that column value with the search term highlighted, much as the document snippet does when the search hit is in the body of the document.

E. Display values for search columns, whether they contain hits or not
  • Because the Search Columns can differ from the columns to be filtered on, it may be of interest to show the search column values regardless.
  • This option can be used to include important meta-data along with the search hit that isn't related to the search itself. This can be important, for example, when the document name (and hence the link to the document) is not descriptive. This can assist the end user in choosing the correct document from the search results (particularly if there is no text snippet available to put the query term into context).

F. Show search box above column choices
  • Arguably this should be in the next section, on "Web Part Display Options", although it relates to the search as well. The search box can be configured to appear above the column choices rather than below, if so desired.

G. Limit on search items to return
  • The SharePoint search request which is executed behind the scenes will return any search hits from the site in which the web part is configured or any of its sub-sites. Once the results are retrieved, they are filtered by the web part (hence the name). Therefore if the web part is placed in a top level site, the potential number of hits may be very large. This option limits the number of hits to avoid excessive delays. It may be increased as necessary, bearing in mind that it might slow down the response.
  • Note: If the search limit is reached, a warning message will appear at the top of the list of results. Because the actual search includes all libraries below the current site, the user may only see 10 or 20 hits which match their criteria, but the return limit can still be reached.

The last section, Web Part Display Options, covers visual effects and other miscellaneous configuration choices. The options here are as follows:


H. Table Grid Style
  • This changes the CSS applied to the web part. Mainly it affects borders around the column headings and choices. It has most effect when the Web Part is set to use checkboxes (see below)

I. Table Color
  • Sets the "main" colour of the web part. The colour will be darkened for the lines (i.e. for borders) and lightened for the background to the column choices.
  • The colour may be specified either as a hexadecimal value (such as {#86B3EE} which is the default MOSS2007 theme colour) or as a named colour (e.g. lightblue).

J. Use ListBoxes instead of CheckBoxes
  • If the expected number of unique values for a column is large, ListBoxes are a better choice. Multiple selections/de-selections can be made using control click and the user can click and drag down to select a whole block of options. This requires slightly more know-how on the part of the end user, but if the number of choices is greater than, say, 10, then this really becomes the only practical way to display them.

K. Reverse Column Value Sort Order
  • Within each column, the unique values are sorted alphabetically. This option allows the sort order to be reversed (Z-A rather than A-Z).

L. Maximum number of unique values for each column
  • Set to 10, by default, this can safely be increased as required if ListBoxes are used to display the column choices.
  • Note: If the number of unique values exceeds this limit, trying to select that column in the Columns section will (silently) fail. If this happens, increase this number, click "Apply", and try again.

M. Show TextBox for Diagnostic messages
  • Only for development/debugging purposes
  • Will display the Schema for the configured library
  • After "Search" has been clicked, will list out the search results in internal format

Now select "OK" and your web part should be ready to go.

Last edited Nov 27, 2010 at 8:47 PM by roncresswell, version 5


No comments yet.