Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author wpdreams

    (@wpdreams)

    Hi!

    That collation should be ok, it’s case and accent insensitive.

    If you open up the plugins/ajax-search-lite/includes/search.class.php file and go to line 41 where you should see this:

    $this->s = mb_convert_case($keyword, MB_CASE_LOWER, "UTF-8");

    Try to remove that line completely, or add comments like this:

    //$this->s = mb_convert_case($keyword, MB_CASE_LOWER, "UTF-8");

    Then try to search again. Let me know if it helps.

    Thread Starter MALiberato

    (@maliberato)

    It doesn’t help. If I do that it won’t find anything, with or without accents.

    Plugin Author wpdreams

    (@wpdreams)

    That means that the row or table collation (not the database collation) is actually not case and accent insensitive, so it differs from the database collation.

    There are tweaks to force utf8_ci collation to the selected rows on php level, but it’s not the best solution as it ignores database table indexing.

    You should check the row collations on the post_title and the post_content rows as well as the table collation.

    The search uses “LIKE” commands to find content, and the LIKE command respects the database collation on SQL level.

    If you try a select command on your database via phpMyAdmin like:
    SELECT post_title as title FROM wp_posts WHERE post_title LIKE '%search phrase%'
    where you replace the “search phrase” with the accented characters, you will get no results either.

    However a query like this might return results:
    SELECT CONVERT(post_title USING utf8) as title FROM wp_posts WHERE post_title LIKE BINARY _utf8'%search phrase%'

    If so, then I might be able to suggest a solution, but I highly recommend checking the collations for rows and tables first.

    Thread Starter MALiberato

    (@maliberato)

    rows and table collation are utf8_general_ci (at least is what phpmyadmin says). you are right… first query doesn’t get any results, second gets one (of 30).
    for the word “gest?o” I only have results if i write gestao.

    Plugin Author wpdreams

    (@wpdreams)

    I’m going to roll out an update very soon, probably monday or tuesday. I will add an option to make it possible to force the utf8 conversion programatically.
    It might be helpful for others as well, if they are having unexpected issues with table collations.

    Thread Starter MALiberato

    (@maliberato)

    ok. thank you.

    Thread Starter MALiberato

    (@maliberato)

    hello.
    do you know when will the update be ready?

    Plugin Author wpdreams

    (@wpdreams)

    Hi!

    Unfortunately only in the beginning of next week. I had too many support tickets with the pro version this week. Stay tuned. You will get a notification in your admin panel!

    I had a similar problem of not able to search if string contained a non-latin symbol.
    The problem as I found out was in using strtolower() function instead of mb_strtolower() on line 23 in ajax-search-lite\search.php file.
    It would be great if author fix it in future versions.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘some characters don't work’ is closed to new replies.