I am using the FULLTEXT
in my sql query to search the records.
SELECT * FROM (SELECT d.DataId, (SELECT [Name] FROM Category WHERE CategoryId = d.CategoryId) AS 'Category', d.Description, d.CompanyName, d.City, d.CategoryId,
d.CreatedOn, d.Rank, d.voteCount, d.commentCount, d.viewCount
FROM Data d
INNER JOIN Keyword k
ON d.DataId = k.DataId
WHERE FREETEXT(k.Keyword, @SearchQ) AND d.CategoryId=@CategoryId AND d.IsSearch=1 AND d.IsApproved=1
When I am searching for rockstone hotel, I have a record with the same name in my table but it displays some other record first and then displays "rockstone hotel's" record at 3 position. Why its happening and what are the way's to improve this ???
I'm using SQL Server 2005
Thanks