Anitra Smith (anitra) wrote,
Anitra Smith
anitra

MSSQL full-text search "wildcard" isn't.

Started playing around with the full-text search features of MSSQL (needed to add useful searching to a project I'm working on). It's pretty neat, in general.

However, I've run into one big problem that's really annoying. "*" acts like a wildcard when searching, but ONLY under specific conditions, namely:
  1. * is within a quoted piece of text (e.g. "foo*" or "foo bar*" will work, but foo* won't)
  2. * will ONLY be recognized as a suffix, not as a prefix - "foo*" will give you the EXACT same results as "*foo*" - in essence, if * is at the beginning of a word, it's ignored, and if it's in the middle of a word, it's treated as a literal character.... and there's no reason to put it in multiple times, anyway, since putting a * at the end of a phrase will act as if you had put * after each word in the phrase.


That last one is the one that annoys me the most. Searching around, it seems the ONLY way to get around this is to put columns with reversed text in your catalog and search them backwards. I really don't want to do that.
Tags: computer, sql, work
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments