我正在尝试实现SQL Server的语义搜索。为了看一个例子,我下载了AdventureWorks2012 (这里有一个“几乎”的逐步指南:https://docs.microsoft.com/en-us/sql/relational-databases/search/find-similar-and-related-documents-with-semantic-search?view=sql-server-2017)。错误说明必须声明@CandidateID和@MatchedID
我试图声明这些ID,而不是得到错误或结果,我得到一个空表。
SELECT TOP(10) KEY_TBL.matched_document_key AS Candidate_ID
FROM SEMANTICSIMILARITYTABLE
(
HumanResources.JobCandidate,
Resume,
@CandidateID
) AS KEY_TBL
ORDER BY KEY_TBL.score DESC;
GO
SELECT TOP(5) KEY_TBL.keyphrase, KEY_TBL.score
FROM SEMANTICSIMILARITYDETAILSTABLE
(
HumanResources.JobCandidate,
Resume, @CandidateID,
Resume, @MatchedID
) AS KEY_TBL
ORDER BY KEY_TBL.score DESC;
GO发布于 2019-09-20 21:33:09
您需要声明这些变量并赋值。只有您知道这些keys.For示例的数据类型:
declare @CandidateID int = 6754,
@MatchedID int = 4321IDs包含来自索引表的真实ids。
https://stackoverflow.com/questions/56516857
复制相似问题