views:

228

answers:

1

I seem to have a weird bug in Microsoft SQL Server 2005 where FREETEXT() searches are somewhat case-sensitive despite the collation being case-insensitive (Latin1_General_CI_AS).

First of, LIKE queries are perfectly case-insensitive, so

WHERE column LIKE '%word%'

and

WHERE column LIKE '%Word%'

return the same results.

Also, FREETEXT are infact case-insensitive to some extent, for instance

WHERE FREETEXT(column, 'Word')

will return results with different cases.

BUT

WHERE FREETEXT(column, 'word')

while still returning case-insensitive matches for word, gives a different resultset. Or, as I found out after some investigation, searching for word gives all matches for different cases of word but searching for Word gives the same PLUS inflectional results.

Or to use one of the actual cases I found, searching for marketingleader returns all results containing that word, independent of the case, whereas searching for Marketingleader would return those, but also results that just contain leader that don't show up when searching for the lower case.

has anyone got any Idea as to what is causing this and how I could turn on inflectional/fuzzy searching for lower-case words as well?

Any help would be appreciated.

+1  A: 

Use the alternative to freetext which is contains and the inflectional results are optional ..

CONTAINS (Transact-SQL)

.. oups just saw that you mention contains in your question, but does it behave the same way as the freetext in the provided examples ?

Gaby
Zenon
when you use the FORMSOF for inflectional and thesaurus does it return different results than the freetext ?
Gaby
`FORMSOF`, be it inflectional or with thesaurus, doesn't return any results other than literal matches for some terms where `FREETEXT` does... On second thoughts, it might not be `FORMSOF` /inflectional related at all, but rather has to do with word breaking being somewhat casesensitive i.e. only performed when the first letter is uppercase. Could this be language related? The database language is german.Well, I could just uppercase the first letters of all search terms programatically, I guess
Zenon
I have had issues myself (it might have been my mistake though.. never resolved it) with word rules for greek language ..Are the search terms always going to be full words ? (i do not know the content of the application, so it could be that someone would search for an ending to a word)..just saying ..
Gaby
it's a job search engine, so people mostly search for jobtitles.Full phrases seem unlikely (at least given the search history/popularity of search terms, most searches are for compound words)
Zenon