有没有人知道是否可以进行词库搜索 与NEAR或AND / OR关键字一起使用。 以下是我想要运行的查询类型的示例:
SELECT Title, RANK
FROM Item INNER JOIN
CONTAINSTABLE(Item, Title, 'FORMSOF(Thesaurus, "red" NEAR "wine")') AS KEY_TBL
ON Item.ItemID = KEY_TBL.[KEY]
ORDER BY RANK DESC
....但我收到错误消息:
在全文搜索条件'FORMSOF(同义词库,“红色”NEAR“wine”)'''NEAR'附近出现语法错误。
答案 0 :(得分:1)
附近和FormsOf彼此之间不能很好地协作。阅读以下链接 Is it possible to combine NEAR and FORMSOF together in a fulltext search?
使用IsAbout
SELECT K.RANK, name, Description
FROM Diagnosis AS C
INNER JOIN
CONTAINSTABLE(diagnosis,name, 'ISABOUT (
FORMSOF(Thesaurus, "red"),
FORMSOF(Thesaurus, "wine"))', 50) AS K
ON C.ID = K.[KEY];
GO
答案 1 :(得分:0)
词库的语法略有不同,您可能正在寻找的是:
SELECT Title, RANK
FROM Item INNER JOIN
CONTAINSTABLE(Item, Title, 'FORMSOF(Thesaurus, "red") NEAR FORMSOF(Thesaurus, "wine")') AS KEY_TBL
ON Item.ItemID = KEY_TBL.[KEY]
ORDER BY RANK DESC