FTS in sql 2005 - sql

Can somebody please explain how to find out if full text search is enabled in SQL 2005.

FTS Installed At the Instance Level
SELECT SERVERPROPERTY('IsFullTextInstalled')
This will return 0 or 1 if full text search is installed (Instance wide).
FTS Enabled At the Database Level
SELECT is_fulltext_enabled FROM sys.databases
WHERE database_id = DB_ID()
This will return 0 or 1 if full text search is enabled in the current database.

See if the SQL Server FullText Indexing service is running.
After that, you have to create a catalog for the database and then the fulltext indexes on the relevant columns.
For more information, refer to the documentation: http://msdn.microsoft.com/en-us/library/ms142497(SQL.90).aspx

Related

Rebuild index menu not available in SSMS for Azure SQL database

Connected to Azure SQL Database from SSMS. The versions are (1) Microsoft SQL Azure (RTM) - 12.0.2000.8 (2) SSMS 18.11.1
Rebuild index menu option not available when right click index folder level or individual index level. The snapshots are attached. What is missing ?
(1) Folder level
(2) Index level
I created SQL database in Azure portal.
Image for reference:
I login in MSSM using Azure SQL server credentials.
Image for reference:
I connected to Azure SQL database in MSSM successfully.
Image for reference:
I also didn't get option of rebuild index
Image for reference:
I used below query to check the list of the indexes in the database, with the most fragmented first.
SELECT
OBJECT_SCHEMA_NAME(ips.OBJECT_ID) 'Schema',
OBJECT_NAME(ips.OBJECT_ID) 'Table',
i.NAME,
ips.index_id,
index_type_desc,
avg_fragmentation_in_percent,
avg_page_space_used_in_percent,
page_count
FROM
sys.dm_db_index_physical_stats(DB_ID(), NULL, NULL, NULL, 'SAMPLED') ips
INNER JOIN
sys.indexes i
ON (ips.object_id = i.object_id)
AND
(
ips.index_id = i.index_id
)
ORDER BY
avg_fragmentation_in_percent DESC
I got the output as below:
I rebuild index of TestTable using below code:
ALTER INDEX <indexName> ON <TableName> REBUILD WITH (ONLINE = ON)
Output:
It worked successfully in my machine please check from your end.

How to use Adobe iFilter 11 with MSSQL Server 2017

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.
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).
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.

Full text index population stuck at Starting on SQL 2012

I have a sql server 2012 box that hosts hundreds of databases. All databases use full text indexing. The indexing has stopped working.
executing this query:
SELECT status_description
FROM sys.dm_fts_index_population
returns status_description equal to Starting for all databases where there has been recent activity.
I created a new database and created a full text index. It has the same problem, the population is not completing.
What can be the cause? Can I somehow reset the full text index service without restaring SQL Server service itself?

Full text search catalog name

I want to find the name of full text search catalog on my SQL Server 2008 database. How can I do that using SQl Server Management Studio or TSQL. I tried using:
SELECT FullTextServiceProperty('IsFullTextInstalled')
and it returns 1.
This query will help:
select name, *
from sys.fulltext_catalogs
You can have more than one full-text search catalog, so the query will return all of them. The one that is default will have is_default = 1.

Fulltext Search in SQL Server 2008 Step by step

How to get started with Fulltext Search in SQL Server 2008
read these links:
SQL SERVER – 2008 – Creating Full Text Catalog and Full Text Search
Using Full Text Search in SQL Server 2008
Setting Up Full Text Search: A Step-by-step Guide
Full-Text Search (SQL Server)
SQL Server 2008 Full Text Search Best Practices from the SQL CAT Team
I would add those links from Simple Talk's web site:
Understanding Full-Text Indexing in SQL Server
SQL Server Full Text Search Language Features
SQL Server Full Text Search Language Features - Part 2