3

I am using SQL Server 2008

DDL

CREATE TABLE [dbo].[t](
    [words] [varchar](1000) NULL,
    [id] [int] IDENTITY(1,1) NOT NULL
) ON [PRIMARY]

DML

insert into t(words)values('this is my laptop')
insert into t(words)values('this does not contains headphone')

SQL Query

SELECT *
FROM 
t as t
JOIN CONTAINSTABLE(t, words,'"headphone*"', 10) fulltextSearch
ON
t.Id = fulltextSearch.[KEY]

Results

No record found

I am expecting one records. Any Idea?

Pankaj
  • 9,749
  • 32
  • 139
  • 283
  • so, which version of sql server are you using? you've tagged both 2005 and 2008. the team brought fts into the engine between these two versions. – swasheck Aug 16 '12 at 19:58

1 Answers1

3

'this' is very likely a noise word (like 'the', 'and', etc), so it would not be included in the index. Try searching for one of the real words in your text.

-- EDIT --

Ok, that wasn't it...

I tried your code and it worked as expected for me - the query returned one record. The only difference is that I defined [id] as the primary key (which you must have done as well, or you couldn't create the index). I am betting your index is not populated - in SSMS, right click on the table, select 'full text index' -> 'start full population'.

Ray
  • 21,485
  • 5
  • 48
  • 64
  • +1 'this' is very likely a noise word (like 'the', 'and', etc), so it would not be included in the index. – Pankaj Aug 16 '12 at 21:02