Add PDF to the Advanced Search in SharePoint 2007 and SharePoint 2010

In certain cases users require the ability to search for specific file types or extensions.  It is easy to add additional file types (that have already been added in Central Administration) to the result types dropdown in the Advanced Search.  This particular example is for adding the PDF file type, however this method can be used with other file types.

Note:  The PDF iFilter must be installed to add PDFs to the SharePoint search

Edit the “Advanced Search Box” web part.
Expand the properties XML by clicking the three dots to the right of the text box.

The Result Types are towards the bottom of the code, so you’ll have an easier time editing in another program like notepad++.

Add the following within the <ResultTypes></ResultTypes> tags:

<ResultType DisplayName=”PDF Documents” Name=”acrobatpdf”>
    <PropertyRef Name=”DocKeywords”/>
    <PropertyRef Name=”FileName” />
    <PropertyRef Name=”Size” />
    <PropertyRef Name=”DocSubject”/>
    <PropertyRef Name=”Created” />
    <PropertyRef Name=”Write” />
    <PropertyRef Name=”Title”/>

Click OK and save. 

The result (“PDF Documents” is now an available filter under Result type in the Advanced Search:

Permalink | Comments (0) | Post RSSRSS comment feed