ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Search problem: Search is case sensitive – sometimes

October 05, 2010 3:14am

Subscribe [4]
  • #1 / Oct 05, 2010 3:14am

    Hi. I have an odd search problem on a site I’m managing, http://www.cehis.se

    When site-searching some words doesnt show up depending on case, but others do.

    Almost all words work fine whether written in upper or lowercase, it finds the pages. We can rule out that the search is case sensitive as searching for “ExEmPeL” returns hits, and it’s certanly not written like than anywhere. Word censoring is also turned of.

    However, some words doesnt work. Searching for “npö” returns no hits, but “NPÖ” does. And “EHÄLSA” doens’t work, but “ehälsa” does.

    I can’t really find a pattern here? Any ideas where to start looking?

    Running ExpressionEngine 1.6.9, Revision:  20100805

    Thanks

  • #2 / Oct 05, 2010 9:01am

    Sue Crocker

    26054 posts

    Which version of MySQL are you using?

  • #3 / Oct 05, 2010 10:49am

    5.0.77

  • #4 / Oct 05, 2010 4:45pm

    Ingmar

    29245 posts

    So it’s only happening with umlauts, is that correct? Do both “NPÖ” and “npÖ” work? (Uppercase Ö in both cases).

  • #5 / Oct 05, 2010 5:08pm

    Yes, both “NPÖ” and “npÖ” works, but lowercase “ö” doesn’t. But it works (both lowercase and uppercase) in all other words we’ve tried. The problem only occurs when typing the word “npö”.

  • #6 / Oct 05, 2010 5:28pm

    Ingmar

    29245 posts

    It looks like an issue with your database collation. Can you run a few custom SQL queries for me?

    SELECT 'a' = 'A', 'a' = 'À', 'a' = 'á', 'ö' = 'Ö', 'u' = 'Ü';

    You should be getting 5 x 1, but I bet there’ll be a few zeros in your case.

    SELECT CHARSET(USER()), COLLATION(USER())

    What do you get?

  • #7 / Oct 05, 2010 6:22pm

    Thanks, take a look at the attached images for the query results.

  • #8 / Oct 06, 2010 9:34am

    Sue Crocker

    26054 posts

    Thanks for posting the screen shots, Fredrik. It looks like the problem is with the collation/version of MySQL you’re using. I’ll ask Ingmar if there is a better collation to use. Thanks in advance for your patience.

  • #9 / Oct 06, 2010 2:38pm

    Ingmar

    29245 posts

    One more, please:

    SELECT COLLATION("test")
  • #10 / Oct 29, 2010 11:48am

    Hi! Missed following up on this!

    Here’s the screenshot of “SELECT COLLATION(“test”)”

  • #11 / Oct 30, 2010 2:09pm

    Greg Salt

    3988 posts

    Hi Fredrik,

    I’ll make sure Ingmar sees your response. Thanks in advance for your patience.

    Cheers

    Greg

  • #12 / Nov 09, 2010 6:30am

    Ingmar

    29245 posts

    There are two collations in use here, utf8_generel_ci and utf8_unicode_ci. The former is a very simple one, basically stripping all accents, converting to upper case and then use that. The latter (utf8_unicode_ci) is clearly the better choice. Can you make sure your default settings and db tables are using that?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases