views:

41

answers:

1

Hello,

I have Full Text catalog created in SQL Server 2005, when I search the text like "Bolivia's History", it returns all the result matching to that, but if I use "Bolivias History", it does not return anything, I am very new to Full Text Search stuff, any lead how to ignore the special character ("'"), in Full Text Search?

Thanks in Advance, Manoj

A: 

Since I am not sure if there exists any special function for your needs, I'd use REPLACE function:

SELECT text
FROM   tablename
WHERE  REPLACE(text, '''', '') LIKE '%Bolivias History%'

In order to ignore more special characters (like ") call multiple REPLACE functions:

SELECT text
FROM   tablename
WHERE REPLACE(REPLACE(text, '''',''), '"', '') LIKE '%Bolivias History%'
Bar
but you are talking about in the case of "Bolivia's History" which is not a issue for me, because it gets me what I want, the issue is with the "Bolivias History", this text is similar to the "Bolivia's History", but could not return anything when I perform a search....
ManojTrek
How can I use the replace in CONTAINSTABLE ?, any suggestion....
ManojTrek
@ManojTrek Sorry, I was wrong about `'\''` sign in query. Have a look on the modified query, please.
Bar
That I figure out, but still I have to use this within the CONTAINSTABLE, not sure How can I achieve this.....
ManojTrek
@ManojTrek sorry, not familiar with `CONTAINSTABLE` yet. Ask that as a separate question.
Bar