Я думаю, вам придется сделать что-то вроде этого:
Select * from TABLE
Where
CONTAINS(*,'FORMSOF(THESAURUS,"keyword")')
OR
CONTAINS(*,'FORMSOF(INFLECTIONAL,"keyword")')
РЕДАКТИРОВАТЬ
В противном случае вам, возможно, придется динамически создавать условия поиска СОДЕРЖИТ, как это:
IF OBJECT_ID('tempdb..#A') IS NOT NULL DROP TABLE #A
IF OBJECT_ID('tempdb..#B') IS NOT NULL DROP TABLE #B
CREATE TABLE #A (pk INT IDENTITY(1,1), word nvarchar(50))
CREATE TABLE #B (word nvarchar(50))
-- load words from thesaurus
INSERT INTO #A (word)
SELECT display_term
FROM sys.dm_fts_parser('FORMSOF (THESAURUS, "mykeyword")',1033,null,0)
DECLARE @cmd NVARCHAR(1000) , @word NVARCHAR(50);
DECLARE @k INT;SET @k = ISNULL((SELECT MAX(pk) FROM #A) , 0 )
-- call INFLECTIONAL for each word
WHILE @k>0
BEGIN
SELECT @word = word FROM #A WHERE pk = @k
SET @cmd = 'INSERT INTO #B (word)
SELECT display_term
FROM sys.dm_fts_parser(''FORMSOF (INFLECTIONAL, "' + @word + '")'',1033,null,0)'
EXEC(@cmd)
SET @k = @k - 1
END
-- list all words
SELECT * FROM #B
DECLARE @FTString NVARCHAR(4000);
SET @FTString = '';
-- build the list of words for CONTAINS
SELECT @FTString =
@FTString +
+ CASE WHEN @FTString=''
THEN ''
ELSE ' OR '
END
+ '"'+word+'"'
FROM #B
-- display the CONTAINS condition
SELECT @FTString
-- final search
SELECT *
FROM dbo.MyTable AS x
WHERE CONTAINS(*, @FTString)