开发者

Can you free text search using a sub query in SQL Server?

开发者 https://www.devze.com 2023-03-24 02:36 出处:网络
I\'m trying to search resumes using a boolean free text search and need to run a subquery. However I can\'t work out if free text boolean searches are possible with subqueries.

I'm trying to search resumes using a boolean free text search and need to run a subquery. However I can't work out if free text boolean searches are possible with subqueries.

Please could you confirm if it is and if possible 开发者_运维技巧reference a link for further investigation?


Yes you can - in SQL Server 2008 r2 at least! I have just tried the following query in SQL Server management studio and it parsed and executed correctly:

SELECT * FROM Resumes WHERE CONTAINS (ResumeText, 'admin*') AND ID IN(
SELECT ID FROM Resumes WHERE CONTAINS(ResumeText, 'sales'))

You can also mix and match fulltext search operators such as

SELECT * FROM Resumes WHERE CONTAINS (ResumeText, 'admin*') AND ID IN(
SELECT ID FROM Resumes WHERE FREETEXT(ResumeText, 'sales manager'))
0

精彩评论

暂无评论...
验证码 换一张
取 消