views:

36

answers:

1

Hi,

I am working on the Full Text Search in Sql Server 2005. I have created a catalog and then an index on a particular table.

I am searching for data using FREETEXTTABLE(tablename,*,@SearchKeyword). So I am searching in all columns in the index since any of the columns can contain the keywords.

Is there is a way for me to know which columns in the index contained my search keywords?(without having to go and look at each column in the resultset)?

I would appreciate any help in this regard. Thanks.

Kalyan.

A: 

To the best of my knowledge, you'd have to query each column individually.

Joe Stefanelli
Hi Joe, Thanks for the reply. As you mentioned I can query each column and find out if it contains the keywords that I am searching for, But I also need to show some sample text from the column that contains the keywords,so how do i know where in the column the keywords were found? Is the keyword present in the first 50 characters or 100 characters..? I would appreciate any suggestions.Thanks.
Kalyan
If you were running SQL 2008, you might be able to leverage [sys.dm_fts_index_keywords](http://msdn.microsoft.com/en-us/library/cc280900.aspx) to answer the "which column" question. As for displaying the sample text, I'm not aware of a way to do this using just SQL Server. This need is probably better served by writing some application code instead.
Joe Stefanelli
Thanks for your help joe,I will try to take that approach and see how it works out.
Kalyan