Forum Moderators: open

Message Too Old, No Replies

SQL Full Text Relevancy

How to prirotize different column weights?

         

RossWal

6:45 pm on May 2, 2008 (gmt 0)

10+ Year Member



Have an emcom site that uses SQL full text for site search. Currently it's implemented in a primitive manner that doesn't rank results - they are displayed in alpha order.

Ideally, I would like to assign my own weight to the columns searched (for ex Title would be more relevant than Description, Manufacture might fall between those two...), and let SQL evaluate the search terms for ranking. The ultimate rank would be a product of my assigned weights and SQL's returned relevancy.

I have some ideas of ways to implement this, but surely I would be creating a poor imitation of a wheel that's already been invented by people way smarter than me. Can anyone point me to resources or examples?

Thanks!

Ocean10000

6:23 pm on May 3, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I am not sure how you have your Full Text Index's setup in Microsoft Sql Server. Its been awhile since I used its internal text search.

But to answer your question it is possible using Full Text search to do what you want.

This is the link to FREETEXTTABLE (Transact-SQL) [msdn.microsoft.com] which I think covers what you want. Basically it returns a table which contains your search result matches with the with a ranking column. You may have to do extra work on your end to return the weighted results for each searched column but it is possible with this method.