Adding Searchable File Types to SharePoint Foundation 2010

Summary

SharePoint Foundation 2010 does not have an interface to add file extensions for additional file types and iFilters. In order to add additional file types for crawling, this process needs to be followed. The following sample shows what to do for PDF files.

More Information

1. Copy the below content to a VBS file and save it (I.E save file name as AddExtension.vbs)

-----------------

Sub Usage

    WScript.Echo "Usage:    AddExtension.vbs extension"
    WScript.Echo

end Sub

Sub Main

    if WScript.Arguments.Count < 1 then
                Usage
                wscript.Quit(1)
   end if

    dim extension
    extension = wscript.arguments(0)

    Set gadmin = WScript.CreateObject("SPSearch4.GatherMgr.1", "")

    For Each application in gadmin.GatherApplications
        For Each project in application.GatherProjects
                    project.Gather.Extensions.Add(extension)
                Next
    Next

End Sub

call Main

-----------------------

2. Copy the above script file to Sharepoint Foundation 2010 Server

3. Run it from Command Prompt
> WScript AddExtension.vbs pdf

4.  Register PDF ifilter as below:
4-1.       Find regkey "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\Search\Setup\ContentIndexCommon\Filters\Extension\"
4-2.       Right-Click – [New]-[Key]. Then specify key name ".pdf"
4-3.       Right-Click (Default) of above ".pdf" key then click "Modify"
4-5.       Specify value "{E8978DA6-047F-4E3D-9C78-CDBE46041603}"
4-6.       Restart SPSearch4

5. Run crawl as below
>stsadm –o spsearch –action fullcrawlstart

6. Confirm the pdf files can be found in search results
Properties

Article ID: 2518465 - Last Review: Mar 12, 2011 - Revision: 1

Feedback