views:

167

answers:

1

Hi, All:

I got a issue about full index, any body can help me on this?

1) set up full text index

CREATE FULLTEXT INDEX ON dbo.Companies(my table name)
(
CompanyName(colum of my table) 
Language 0X0
)
KEY INDEX IX_Companies_CompanyAlias ON QuestionsDB
WITH CHANGE_TRACKING AUTO
GO

2) Using CONTAINS to find the matched rows

SELECT CompanyId, CompanyName
FROM dbo.Companies
WHERE CONTAINS(CompanyName,'Micro')

3) All is going well. just just just return empty resultset. And I am sure there is company with CompanyName "Microsoft" in Table Company

Much appreciated if anybody does me a favor on this.

+1  A: 

Your CONTAINS(CompanyName,'Micro') is looking for the word Micro, if you want a prefix match to pick up "Microsoft" use the syntax: CONTAINS(CompanyName,'"Micro*"').

Alex K.
Alex , you are correct, I use your method, it works for me. much appreciated!
max
@max - Glad you got it sorted. You should click the tick to the left of Alex's answer to mark it as answered.
Martin Smith
@Martin, thnx for reminding since this is my first post at Stackoverflow.
max