2

有谁知道是否可以与 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(Thesaurus, "red" NEAR "wine")' 中的 'NEAR' 附近的语法错误。

4

2 回答 2

1

Near 和 FormsOf 不能很好地相互配合。阅读以下链接 是否可以在全文搜索中将 NEAR 和 FORMSOF 结合在一起?

利用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
于 2017-07-07T11:10:39.240 回答
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
于 2010-07-29T13:12:32.877 回答