关闭

semantic search examples

标签: semanticsearchtablejoin
445人阅读 评论(0) 收藏 举报
分类:

Example 1: Find the Top Key Phrases in a Specific Document

The following example retrieves the top 10 key phrases from the document specified by the @DocumentId variable in the Document column of the Production.Document table of the AdventureWorks sample database. The @DocumentId variable represents a value from the key column of the full-text index.

 

SELECT TOP(10) KEYP_TBL.keyphrase
FROM SEMANTICKEYPHRASETABLE
    (
    Production.Document,
    Document,
    @DocumentId
    ) AS KEYP_TBL
ORDER BY KEYP_TBL.score DESC;
GO


 

Example 2: Find the Top Documents that Contain a Specific Key Phrase

The following example retrieves the top 25 documents that contain the key phrase “Bracket” from the Document column of the Production.Document table of the AdventureWorks sample database.

SELECT TOP (25) DOC_TBL.DocumentID, DOC_TBL.DocumentSummary
FROM Production.Document AS DOC_TBL
    INNER JOIN SEMANTICKEYPHRASETABLE
    (
    Production.Document,
    Document
    ) AS KEYP_TBL
ON DOC_TBL.DocumentID = KEYP_TBL.document_key
WHERE KEYP_TBL.keyphrase = 'Bracket'
ORDER BY KEYP_TBL.Score DESC;
GO


 

Example 3: Find the Top Documents That Are Similar to Another Document

The following example retrieves the top 10 candidates who are similar to the candidate specified by @CandidateID from the HumanResources.JobCandidate table in the AdventureWorks2012 sample database.

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


Example 4: Find the Top Key Phrases That Are Similar between Documents

The following example retrieves the 5 key phrases that have the highest similarity score between the specified candidates in HumanResources.JobCandidate table of the AdventureWorks2012 sample database.

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


0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:183299次
    • 积分:3391
    • 等级:
    • 排名:第9935名
    • 原创:154篇
    • 转载:0篇
    • 译文:3篇
    • 评论:30条
    文章分类
    最新评论