我使用SQL Server全文向导创建了一个全文索引,但是当我传入一个搜索词时,它不会忽略停用词。
即。这将返回行:
SELECT *
FROM dbo.T_Restaurant AS Restaurant
JOIN dbo.SearchView AS SearchView ON SearchView.id = Restaurant.id
WHERE CONTAINS(SearchView.TotalSearchField, ' indian & bridgwater ')
但这不是:
SELECT *
FROM dbo.T_Restaurant AS Restaurant
JOIN dbo.SearchView AS SearchView ON SearchView.id = Restaurant.id
WHERE CONTAINS(SearchView.TotalSearchField, ' indian & in & bridgwater ')
我知道'in'是英语中的一个禁用词,但似乎并没有被忽略。索引根据其属性使用系统禁用词列表。我错过了设置禁用词汇表的步骤吗?
非常感谢,
克里斯。
答案 0 :(得分:1)
这种FTS语法是否更好?我认为它将采取印度和布里奇沃特是一个短语,而不是寻找我认为你想要做的话。
SELECT *
FROM dbo.T_Restaurant AS Restaurant
JOIN dbo.SearchView AS SearchView ON SearchView.id = Restaurant.id
WHERE CONTAINS(SearchView.TotalSearchField, '"indian" AND "bridgwater"')
SELECT *
FROM dbo.T_Restaurant AS Restaurant
JOIN dbo.SearchView AS SearchView ON SearchView.id = Restaurant.id
WHERE CONTAINS(SearchView.TotalSearchField, '"indian" AND "IN" AND "bridgwater"')