Solved

Full Text Search CONTAINSTABLE 'OR' Search Ranking

Posted on 2012-03-15
2
487 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
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.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

733 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