Hello, I have added Full Text Search to my sql server 2008 express database and created an index catalog for two columns in a single table. So now, I have to rewrite one of my stored procedures but I have no idea where to begin. The following is my current SP that I need to convert to take advantage of the full text search capability:
ALTER PROCEDURE [dbo].[sp_page_GetPostsBySearchFront]
(
@Title nvarchar(256),
@Content nvarchar(MAX),
@startRowIndex INT,
@maximumRows INT
)
AS
BEGIN
SELECT
RowNumber,
postId,
Title,
Content,
DateCreated,
IsPublished,
PublishOnDate,
Type,
MenuName
FROM
(
SELECT ROW_NUMBER() OVER (ORDER BY posts.postId DESC) AS RowNumber,
posts.postId,
posts.Title,
posts.Content,
posts.DateCreated,
posts.IsPublished,
posts.PublishOnDate,
posts.Type,
posts.MenuName
FROM posts
GROUP BY
posts.postId,
posts.Title,
posts.Content,
posts.DateCreated,
posts.IsPublished,
posts.PublishOnDate,
posts.Type,
posts.MenuName
HAVING (posts.Title LIKE N'%' + @Title + N'%')
OR (posts.Content LIKE N'%' + @Content + N'%')
AND (posts.IsPublished = 1)
AND (posts.PublishOnDate <= GETDATE())
) as u
WHERE u.RowNumber > @startRowIndex
AND u.RowNumber <= (@startRowIndex + @maximumRows)
END
Could some one explain how I go about accomplishing this task? Do I use CONTAINS or FREETEXT and where do I add it. I'm just lost on this? Thank you!