Optionally provide private feedback to help us improve this article...

Thank you for your feedback!


Searching Attachments with InstantKB

To search attachments within InstantKB you must first ensure full text search is enabled on your InstantKB database.

Store Attachments In The InstantKB database

This is the default setting so you may not need to make any changes here however you should double check attachments are being stored in the database. This is required to ensure InstantKB saves attachments to the InstantKB_Attachments database table and this can be indexed by SQL Server.You can check if attachments are stored within your InstantKB database from the "Admin CP » Settings » Knowledgebase" page as shown below. Notice "To Database" is checked. You can also see within the highlighted are we have the "Search Attachments" checkbox ticked...

Ensure "Search Attachments" is enabled

From within the "Admin CP » Settings » Knowledgebase" page ensure the "Search Attachments" check box is checked as shown below...

These changes will ensure InstantKB attempts to also search the contents of your attachments during any keyword search. The next step is to actually now include the Attachment database field within the full-text catalog we previously created. This is detailed in the next section.

Defining the full-text index for attachments

IMPORTANT: The full-text search is not supported on Microsoft SQL Server LocalDB and Express editions. You will need at least Microsoft SQL Server Web edition or higher to use full-text search.

If you enable searching of attachments within the "Admin CP » Settings » Knowledgebase" page you'll need to ensure attachments are saved to the database and that you create a new full text index on the "InstantKB_Attachments" table and index the "AttachmentBlob" column.

You'll need to also select a language for the AttachmentBolb field as it's a binary field. You should choose the language the majority of your attachments will be written in. The suggested settings for this index are shown below...



The SQL Server full-text search supports searching the following file types out-the-box...

  • ASP, ASPX, CSS, HTM, HTML, HHT, HTW, HTX, ODC, STM, EML
  • DOC, DOT, POT, PPS, PPT, XLB, XLC, XLS, XLT, RTF
  • TXT, ASM, BAT, C, CPP, CXX, CMD, DEF, DIC, H, HPP, XML

Searching PDFs from within InstantKB

To assist with the installation of iFilters we'll walk through a quick example below of how to install the Adobe PDF iFilter to ensure the contents of PDF files are also searched within InstantKB.

For a complete list of 3rd party IFilters please see the related links section below.You will first need to install the Adobe PDF iFilter on your SQL Server machine. You can download the free Adobe PDF iFilter from the Adobe web site below..

http://supportdownloads.adobe.com/detail.jsp?ftpID=5542

The installation process is wizard based and just requires you click "Next" on each screen...

You can accept the default settings for all steps within the installation wizard...

Once you've installed the Adobe PDF iFilter please stop and restart both the SQL Server service (MSSQLSERVER) & the SQL Full-Text Filter Daemon.To restart the SQL Server service via the command prompt you must launch the command prompt in the context of an administrator and use...

net stop mssqlserver
net start mssqlserver

This can be seen below...

To restart the Filter Daemon service you can execute the following TSQL from within SQL Server Management Studio...

EXEC sp_fulltext_service 'restart_all_fdhosts'

You can see the results of this below...

You can of course also do this via the SQL Server Configuration Manager as shown below...

Once you've restarted the SQL Server instance and SQL Full-Text Daemon service you may need to register the newly installed iFilters with SQL Server using the following commands...

EXEC sp_fulltext_service 'load_os_resources', 1;
EXEC sp_fulltext_service 'verify_signature', 0;
EXEC sp_fulltext_service 'update_languages' 

Now use the following query within SQL Server Management Studio to determine if the installation was successful.

select document_type, path from sys.fulltext_document_types where document_type = '.pdf'

If everything was successful within the results panel you should see...


This indicates the installation was successful. As your catalog updates you should see results returned for your new content type. If you have PDF files already attached to articles and stored in the database these will be indexed and the associated articles will appear within search results.

Searching Microsoft Office Documents

If you would like to search Microsoft Office documents similar to the PDF iFilter from Adobe you'll need the latest the Office 2010 Filter Pack available from Microsoft on your SQL Server machine. We would also suggest you download and install both Service Pack 1 and Service Pack 2 for the Office 2010 Filter pack. At the time of writing this article (March 2017) this is still the latest filter pack available from Microsoft.

Once installed you will need to restart SQL Server and the SQL Server Full-Text Daemon service as detailed above within our PDF example. Then use the following TSQL from within SQL Server Management Studio to regular the Office Filter pack with SQL Server...

--Load the new filters: 
EXEC sp_fulltext_service 'load_os_resources', 1
--Update the list of components maintained by SQL Server: 
EXEC sp_fulltext_service 'update_languages' 
--Restart the filter daemon host processes: 
EXEC sp_fulltext_service 'restart_all_fdhosts'

Once installed InstantKB can index attachments of the following types...

  • Legacy Office Filter (97-2003; .doc, .ppt, .xls)
  • Metro Office Filter (2007; .docx, .pptx, .xlsx)
  • Zip Filter
  • OneNote filter
  • Visio Filter
  • Publisher Filter
  • Open Document Format Filter

Catalog Population

Whilst SQL Server will periodically populate your catalog after installing your iFilters and verifying they are working you can manually populate your catalog again. You will need to expand your database, expand storage and Full Text Catalogs. Right click your full text catalog and choose "Rebuild".​

Using 3rd party iFilters to extend the file types included within search

You can search additional file types such as PDF files or CHM files through the use of 3rd party SQL Server iFilters. Installing an iFilter is straight-forward and no additional configuration is required within InstantKB once the iFilter has been installed.

Providing the "InstantKB_Attachments.AttachmentBlob" column is included within your fulltext catalog as detailed above the content types covered by the iFilter will automatically be included within InstantKB search results as the catalog updates.

That's It!

We hope this information helps you improve your InstantKB search. If you have any comments or questions please don't hesitate to submit a support request.