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 2005 Forums
 Transact-SQL (2005)
 Compare 2 cols using FT Search for similar match

Author  Topic 

RGoodSolutions
Starting Member

2 Posts

Posted - 2012-11-01 : 14:56:38
Hi,
Thanks very much for your response.

I have a table that i created a Full-Text Search catalog/ index on two different columns within the same table.

I need to create an sproc that performs a search of the two columns and then matches similar rows with a ranking of each.

I have played with some examples using the 'CONTAINSTABLE' function and have got back results but i have had to hard code the search condition just to see if that would result in some relevant data.

I then tried doing something like '"*" NEAR "*"' and that resulted in a empty data set.

What i am really trying to do is just a simple 'column NEAR column' as the search condition.

Any response would be greatly appreciated.

Thanks,
Ron

RGoodSolutions
Starting Member

2 Posts

Posted - 2012-11-01 : 15:28:43
Here is a query that i played with so far.


SELECT [ftProjects].[ProjectID]
, [ftProjects].[ClientID]
, [ftProjects].[ProjectTitle]
, [ftProjects].[ProjectDescription]
, [keyProjects].RANK
FROM [dbo].[Projects] AS [ftProjects]
INNER JOIN CONTAINSTABLE([dbo].[Projects]
, ([ProjectTitle]
, [ProjectDescription])
, 'Review NEAR Review', 10) AS [keyProjects]
ON [ftProjects]. [ProjectID] = [keyProjects].[KEY]
Go to Top of Page
   

- Advertisement -