(This a follow up to this question)
I have a table with customers. The table has one column Name
that has a full text index. One of the customers has the surname 'Said' and another has the surname 'Saiid'.
Name
---------
Joe Said
Joe Saiid
When I query for 'Said' using the CONTAINS predicate nothing is returned. But querying for 'Saiid' using CONTAINS
returns the record.
Here is a demo, using the suggestion from this answer
CREATE TABLE T_NOM
(NOM_ID INT IDENTITY CONSTRAINT PK_NOM PRIMARY KEY,
NOM_NOM VARCHAR(32))
INSERT INTO T_NOM VALUES
('Joe'),
('Joe Doe'),
('Joe Bar'),
('Foo Joe'),
('Alice Bob'),
('Charles David'),
('Elizabeth Fred'),
('Joe Said'),
('Joe Saiid')
GO
CREATE FULLTEXT CATALOG FT;
GO
CREATE FULLTEXT INDEX ON T_NOM (NOM_NOM) KEY INDEX PK_NOM ON FT;
GO
Again, this returns nothing
SELECT * FROM T_NOM WHERE CONTAINS(NOM_NOM,'Saiid');
These 2 queries return the record for Joe Said and Joe Doe respectively.
SELECT * FROM T_NOM WHERE CONTAINS(NOM_NOM,'Said');
SELECT * FROM T_NOM WHERE CONTAINS(NOM_NOM,'Doe');