Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 FullText Search Combined with Ranking

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-03-28 : 21:04:51
Anton writes "My problem is as follows. I currently have multiple full-text indexed tables. The user is able to search using a drop down to select All words, any word, exact phrase or boolean search. What I now need to do is add ranking to this. I shall attach one of my queries that I have done which works fine for the "any words" search.

My question is how to integrate the CONTAINSTABLE command with the query I already have.

I have pasted my query below:

SELECT Stock.StockID, Stock.StockName, Stock.ShortStockDescription, Stock.StockDescription, Stock.Price, Category.CategoryID, Category.CategoryName, ProductType.ProductTypeName
FROM Category INNER JOIN CategoryCross ON Category.CategoryID = CategoryCross.CategoryID INNER JOIN Stock ON CategoryCross.StockID = Stock.StockID LEFT OUTER JOIN ProductType ON Stock.ProductTypeID = ProductType.ProductTypeID
WHERE (CONTAINS(Stock.StockName, '"*cat*"') OR CONTAINS(Stock.ShortStockDescription, '"*cat*"') OR CONTAINS(Stock.StockDescription, '"*cat*"') OR CONTAINS(Category.CategoryName, '"*cat*"')) AND (Category.CategoryID IN (26, 38, 39, 40, 41, 42, 43, 44, 45, 47, 50, 51, 52, 54, 55, 57, 59, 60, 62, 64, 66, 67, 68, 69, 71, 72))
ORDER BY CategoryName, StockName

I am using SQL Server 7.0 and IIS4.

Thank you for your help."
   

- Advertisement -