THE SQL Server Blog Spot on the Web
Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | Join | Help
in Search

Searching for reference numbers with dashes and single digits

Last post 07-21-2008, 6:29 by Diana. 1 replies.
Sort Posts: Previous Next
  •  07-16-2008, 5:33 7865

    Searching for reference numbers with dashes and single digits

    Hi All

    I read a post of Hilary's somewhere that proposed changing hypens in reference codes to HYPHEN so the indexing could treat them as a phrase (as long as the search also did this replace). This would mean changing data and then having to put it back to hypens on output to any of our applications, which is a fairly serious amount of work to do.

    I wondered if a workable approach could be to stop the word breakers from using a hyphen to break words in certain cases? I see that word breakers are classes which could be rewritten or overidden, so it might be possible to prevent breaking when the format x-x is found? It is only with single characters in front of or behind that the phrase search ("x-x") fails.

    Here's an example of the type of refence we need to search for:

    326 IAC 2-6.1-7 (this is reference to a law)

    It is important that a single character change does what is expected and doesn't find the above reference. At the moment, the search looks for everything up to the hyphen and therefore returns many incorrect results. (Note that a Google search finds this without problems)

    I am moving from a Google Search Appliance (gsa)  that indexes these references correctly, so I don't want to lose functionality in this changeover. The gsa is 3 years old now and I don't want to re-licence it at the current price.

  •  07-21-2008, 6:29 7933 in reply to 7865

    Re: Searching for reference numbers with dashes and single digits

    This behavior seems to be "intrinsic", see

    http://support.microsoft.com/kb/923317

    I also encountered another anomaly,  again "by design" - the result of a wildcard search like "SELECT...WHERE CONTAINS(<field_name>, '"n*"')..." includes numeric data.

Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement