开发者

Boolean search on SQL Server, joining searches question

开发者 https://www.devze.com 2023-03-24 10:35 出处:网络
I am trying to create a user-friendly method of allowing employers to search resumes based on Essential (they must have it) and Desirable (would be nice to have). I was thinking Essential could = AND,

I am trying to create a user-friendly method of allowing employers to search resumes based on Essential (they must have it) and Desirable (would be nice to have). I was thinking Essential could = AND, Desirable could = OR.

So for example I have come up with the following input fields:

Essential = "Sales"
AND
Essential = "Manager"
AND
Essential = "Telesales"
~
Desirable = "Insurance"
OR
Desirable = "Finance"

This search would mean the candidate MUST have "Sales" AND "Manager" AND "Telesales" and if this in their CV i开发者_如何学Got would also be good if they have "Insurance" AND/OR "Finance"

However I've got no idea how to run the query that would first look for the Essentials, and only then the Desirables, then rank accordingly using SQL Server.

Any thoughts would be greatly appreciated.

I should also mention that the query will be free-text.


Run your desirables query on a subquery with all your essentials.

0

精彩评论

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