2012年3月27日星期二

Full Text Search Weighted Question

Hello,

I have the following query:

USE test
SELECT new.[key], new.rank,
test_Class.Manufacturer,
test_Class.Model,
test_Class.Title,
test_Class.Description

FROM test_Class
INNER JOIN
FREETEXTTABLE(test_Class, (Manufacturer, Model, Title, Description), 'Logan') AS new
--CONTAINSTABLE(test_Class, (Manufacturer, Title, Description), 'Logan Magnolia') AS new
--FREETEXTTABLE(test_Class, (Manufacturer, Title, Description), 'Logan') AS new
on test_Classs.Class_ID = new.[key]
ORDER by rank desc

I want to have the search work so that if the word logan is in the Manufacturer Column it has a higher rank than if it apeared twice in the description. Basically I want to weight the colomn instead of specific words in the search, which I know how to do. Any Help would greatly be appricated.

Thanks,
TJBump.... is this even possible to do what I am looking to do, I have looked around a bunch and haven't found anything.....

TJ|||Something like this might do (untested):

SELECT new.[key], row_number() over(order by new.rnk) [rank],
xSell_Classifieds.Manufacturer,
xSell_Classifieds.Model,
xSell_Classifieds.Title,
xSell_Classifieds.Description

FROM xSell_Classifieds
INNER JOIN
(select *,0 rnk
from FREETEXTTABLE(xSell_Classifieds, (Manufacturer), 'Logan')AS f1
union all
select *,1 rnk
from FREETEXTTABLE(xSell_Classifieds, (Model, Title, Description), 'Logan')AS f2) as new on xSell_Classifieds.Classified_ID = new.[key]
ORDER by [rank] desc

没有评论:

发表评论