max
max

Reputation: 3

SQL SERVER FULL-TEXT INDEX, CONTAINS return empty

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.

Upvotes: 0

Views: 2139

Answers (1)

Alex K.
Alex K.

Reputation: 175766

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*"').

Upvotes: 1

Related Questions