Solved

Full Text Search CONTAINSTABLE 'OR' Search Ranking

Posted on 2012-03-15
2
491 Views
Last Modified: 2012-03-16
Hi,
I am executing the below query against the DimEmployee table in AdventureWorksDW
I have successfully set up FullText

SELECT
e.EmployeeKey
,e.FirstName
,e.LastName
,e.Title
,a.[RANK]
FROM
CONTAINSTABLE(DimEmployee, Title,'Marketing OR Assistant',10) a,
DimEmployee e
WHERE a.[KEY] = e.EmployeeKey

So I am searching for the top 10 employees who have 'Marketing' or 'Assistant' in their Title.
The following are the results
EmployeeKey      FirstName      LastName      Title      RANK
2      Kevin      Brown      Marketing Assistant      80
7      David      Bradley      Marketing Manager      80
8      David      Bradley      Marketing Manager      80
48      Sariya      Harnpadoungsataya      Marketing Specialist      80
98      William      Vong      Scheduling Assistant      80
99      William      Vong      Scheduling Assistant      80
106      David      Barber      Assistant to the Chief Financial Officer      80
109      Mary      Gibson      Marketing Specialist      80
122      Jill      Williams      Marketing Specialist      80
130      Sean      Chai      Document Control Assistant      80

The RANK returned for each record is 80
Is there a way to return all the same records as above, but that records that have both the words 'Marketing' and 'Assistant' would get a higher rank number?
0
Comment
Question by:Barry Cunney
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Accepted Solution

by:
patrikt earned 500 total points
ID: 37724665
You have to use weighted term. Rank is counted from weight.

Try this:
CONTAINSTABLE(DimEmployee, Title,'ISABOUT (Marketing weight (.5), Assistant weight (.5) )',10)

Open in new window



Description by MS:
http://msdn.microsoft.com/en-us/library/ms142524.aspx
0
 
LVL 17

Author Closing Comment

by:Barry Cunney
ID: 37728754
Thank you Patrikt
0

Featured Post

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question