1

I am using sql server 2019. I created a full text index based on the example of Microsoft, but there is a problem, when part of a word is searched in the text, there is no result

sql server version:

Microsoft SQL Server 2019 (RTM-CU13) (KB5005679) - 15.0.4178.1 (X64) 
    Sep 23 2021 16:47:49 
    Copyright (C) 2019 Microsoft Corporation
    Enterprise Edition (64-bit) on Windows Server 2019 Datacenter 10.0 <X64> (Build 17763: ) (Hypervisor)

for example :

CREATE TABLE Flags (Country nvarchar(30) NOT NULL, FlagColors varchar(200));  
CREATE UNIQUE CLUSTERED INDEX FlagKey ON Flags(Country);  
INSERT Flags VALUES ('France', 'Blue and White and Red');  
INSERT Flags VALUES ('Italy', 'Green and White and Red');  
INSERT Flags VALUES ('Tanzania', 'Green and Yellow and Black and Yellow and Blue');  
SELECT * FROM Flags;  
GO  
  
CREATE FULLTEXT CATALOG TestFTCat;  
CREATE FULLTEXT INDEX ON Flags(FlagColors) KEY INDEX FlagKey ON TestFTCat;  
GO   

Now I search for the word blu but there is no result despite the word blue(I need a fuzzy search)

like this query :

SELECT * FROM FREETEXTTABLE (Flags, FlagColors, 'Blu');  

What is the reason?

1 Answer 1

2

try this one:

SELECT *  FROM flags WHERE CONTAINS(FlagColors,'"Blu*"') ;

https://learn.microsoft.com/en-gb/archive/blogs/sqlforum/faq-how-can-i-perform-wildcard-searches-in-full-text-search

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.