Friday, February 24, 2012

full-text search and wildcard

hello,

i want to search for "any phrase here*" where i want it to match the exact same phrase and followed by anything. but the problem is that when using the following syntax: contains(myTbl,'"my phrase here*"') i will get results like "my123 phrases here" so the wildcard will be applied to the consecutive words and not the last word.

How can i search for an exact phrase followed by anything?

ps: i cant omit the wildcard becoz the last word is not exact

so treating the space as any other character and not as a seperator in the search_expression may be a solution but how to do it

Thanks
samhamMaybe this would work?

where PATINDEX ( 'any phrase here%' , YourTextColumn) <> 0|||patindex has nothing to do with full-text search functionality|||thx blindman for the reply but as ms_sql_dba said this is not full-text search, using the full-text search functionality is a must|||I guess I don't understand why, if the full-text search logic is too fuzzy for your requirements, you can't use a normal character-string searching function.|||i wanted to make my search as fast as possible but it seems that full-text search is a wrong decision in my case becoz am searching in a column containing file Path which contains back slashes and back slashes r considered as white spaces while indexing so my search wont be accurate anyway.

becoz the following 2 path will be the same if using fts:

folder 1/folder 2
and
folder/1/folder 2

so i'll give up using fts

:(

No comments:

Post a Comment