Here is an example full-table lookup table in the FTSdata field:
CREATE TABLE dbo.tTest (Id INT, FTSdata VARCHAR(100)); INSERT INTO dbo.tTest (Id, FTSdata) VALUES (1, 'foo WordA'), (2, 'foo WordAaabbb'), (3, 'WordB bar'), (4, 'WordBbbaaa bar');
I would like to find all these entries regardless of whether users typed βWordAβ or βWordBβ.
My thesaurus looks like this:
<expansion> <sub>WordA</sub> <sub>WordB</sub> </expansion>
I need something like
SELECT * FROM dbo.tTest WHERE CONTAINS(FTSdata, 'FORMSOF (THESAURUS, "WordA*")');
But, unfortunately, the asterisk is not supported in the FORMSOF predicate.
source share