4

I'm trying to get iFilter to work, I'm running Windows 10 64-bit with MS SQL Server 2017/2016 Developer version. I've downloaded the 64-bit version of iFilter 11 from Adobe website and I followed their guide here. Even though it's for MS SQL 2008/2012 it's still pretty easy to follow.

My problem is that the full-text search doesn't return any results.

I installed iFilter 11 64-bit and added it to the system PATH. I confirmed that this is working by restarting the pc and finding the DLL from cmd.

After that, because I didn't have the FullText search component of MSSQL Server, I installed it and started the SQL Full-text Filter Daemon Launcher (I also restarted the main MSSQL Server instance).

I already had a DB and apparently FullText search are enabled by default now so I continued with the installation.

I loaded the components and verified that everything is recognized by running the following queries:

GO
PRINT FULLTEXTSERVICEPROPERTY('IsFullTextInstalled')
exec sp_fulltext_service 'load_os_resources', 1
exec sp_fulltext_service 'verify_signature', 0

/* Verify if iFilter is installed */
SELECT * FROM sys.fulltext_document_types WHERE document_type = '.pdf'
GO
/* Restart MSSQL before continuing */


/* Enable fulltext search on the database */
 Use [db]
 GO
 EXEC sp_fulltext_database 'enable'

 GO
 Use [db]
 DROP TABLE pdfifiltertable
 GO
 CREATE TABLE pdfifiltertable(
  PdfID INT IDENTITY NOT NULL,
  PdfFileName VARCHAR(MAX),
  Ext VARCHAR(10),
  PdfText VARBINARY(MAX),
  CONSTRAINT PK_PdfID PRIMARY KEY (PdfID)
 )

 GO
 CREATE FULLTEXT CATALOG pdfCatalog AS DEFAULT

 GO
 CREATE FULLTEXT INDEX ON pdfifiltertable([PdfText] Type column [Ext] LANGUAGE 'French'
 ) KEY INDEX PK_PdfID with change_tracking auto
 GO


 /* Check if the table correctly have a fulltext_index */
 SELECT distinct
    object_name(fic.[object_id]) table_name,
    [name] column_name
FROM
    sys.fulltext_index_columns fic
    INNER JOIN sys.columns c
        ON c.[object_id] = fic.[object_id]
        AND c.[column_id] = fic.[column_id]


GO

/* Try to search (doesn't work) */
SELECT PdfFileName
FROM [db].[dbo].[pdfifiltertable]
WHERE CONTAINS(PdfText, 'Adobe')

With the queries I was able to:

  • Verify that the FullText Search component is installed
  • I was able to load the different filters and verify that iFilter was being loaded.
  • I have also made sure that fulltext is enabled on the database even though it is on by default.
  • I've created a table and a catalog and I specified the most complex language that it will be used for (French).
  • After creating my table and my catalog I ran a query to verify that the PdfText column had a text index and it did.

Following Adobe own guide, I created their sample WinForm application to upload PDFs. I uploaded 2 PDF, one in French, the other in English. I then searched for simple words that should be contained in them but no results were returned.

I have tried rebuilding the Catalog and rebuilding all index for my pdf table but it didn't change the result.

I tried Installing iFilter 9 by downloading the file PDFiFilter64installer.zip from Adobe ftp in case the newest version had any problem. Unfortunately, it doesn't work either. I have ran a profiler on the MSSQL server and no error is being thrown.

I have searched and gathered multiple related questions which helped me build my complete troubleshooting. I will link them so that they are easier to search together:

SQL Server : full-text pdf search results using contains and ifilters - Not answered

Using full-text search with PDF files in SQL Server 2008 - No working answer for MSSQL 2017.

Using full-text search with PDF files in SQL Server 2005 - Not working for MSSQL 2017 either.

I'm thinking that maybe iFilter just doesn't work on newer OS and newer version of MSSQL.

Tristan
  • 1,349
  • 2
  • 16
  • 25
  • Please check this answer. It worked for me on SQL 2014 and iFilter 11 64 bit. https://stackoverflow.com/questions/7690921/sql-server-pdf-full-text-search-not-working-on-filestream-pdf-file?rq=1 – CleanBold Jun 12 '18 at 07:12

2 Answers2

0

Try to use iFilter 9 - ftp://ftp.adobe.com/pub/adobe/acrobat/win/9.x/PDFiFilter64installer.zip and install it to a short path (C:\iFilter works for me).

0

I got it working on SQL Server 2019

Following these tips https://dba-presents.com/index.php/databases/sql-server/48-full-text-search-with-pdf-documents-in-sql-server-2014 using a newer URL to the iFilter: https://supportdownloads.adobe.com/thankyou.jsp?ftpID=5542&fileID=5550 I used the short name version of my iFilter path (i.e. c:\SQLSer~1\IFilter) I had a little challenge getting the SQL Server account to access the IFilter\bin directory but used this https://www.thewindowsclub.com/fix-failed-to-enumerate-objects-in-the-container to help me get that straight.

I restarted my computer after I did all the steps (because not doing so didn't work for me) and now it works for me. Hope this is useful to someone else.

Jeff Winchell
  • 103
  • 1
  • 8