Thursday, March 8, 2012

How to get the full-text search working for Office document (docx) in SQL Server


Run the following query in SQL Server Management Studio.

SELECT document_type, class_id,[path] FROM sys.fulltext_document_types

WHERE document_type = N'.docx';

SELECT *

FROM TableName

WHERE FREETEXT(*, 'ram') and filetype='docx'

If the free text is not giving the result for documents(docx), then download the Microsoft Filer pack from the following links.

Microsoft Office 2007 Filter Packs

http://www.microsoft.com/downloads/details.aspx?FamilyId=60C92A37-719C-4077-B5C6-CAC34F4227CC&displaylang=en


Microsoft Office 2010 Filter Packs

http://go.microsoft.com/fwlink/?LinkId=179530

1. Download and install Microsoft Filter Pack,

2. Enable IFilters, and then run the following command in that instance:

sp_fulltext_service 'load_os_resources', 1

3. Restart the SQL Server service.

4. Refresh the document Catalog of the database.

5. Disable and Re-enable the Full Text Index of the table.

For more information, please see

How to register Microsoft Filter Pack IFilters with SQL Server 2005 and with SQL Server 2008

If you had registered, I think we need to verify whether the file name extension correct.

No comments:

Post a Comment