Groups | Blog | Home
all groups > sql server full text search > june 2007 >

sql server full text search : Not getting proper result using contains


Raj Gandhi
6/27/2007 6:36:06 AM
I am a software developer and working on one of the client application where
Full text search is required.

Requirement:
The search should allow to use whild cards.....

Problem:
the full text search does not work for postfix terms.....

I have three rows in my table
1. Marketing
2. Mark
3. Remark

When I search "Mark*" it will return me

Mark and Marketing but not Remark

When I search using "*Mark*" it will return the same result

I am expecting that all rows should come but unfortunately I am getting same
result.

I am not sure where I am making mistake. I appreciate your time and effort
to help me.

e.g. if user specifies 'Mark' as keyword the search should match 'Mark',
'Marketing' and 'Landmark'.... right now the CONTAINS clause ignores the
'LandMark'

Thank you

Hilary Cotter
6/27/2007 8:33:16 PM
You are getting the proper result, but not the one you want. Wildcards only
work on suffixes not prefixes.

--
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com

[quoted text, click to view]

Simon Sabin
6/28/2007 10:23:18 PM
Hello Raj,

To get prefix wildcards you need to store a reverse of the string and perform
two searches. Thats only possible if you content is text


Simon Sabin
SQL Server MVP
http://sqlblogcasts.com/blogs/simons


[quoted text, click to view]

AddThis Social Bookmark Button