Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2003

    Unanswered: MySQL full text searching and special characters (accented etc)

    I'm using mysql 4 and full text searching. Currently there are problems with the searching resulting from special/accented characters in the database and inputted in the search.

    A user should be able to enter either the 'special' version or the plain version and be returned both from the databse:

    a or should match a and
    or e should match e and
    smart apostrophe should match smart apostrophe or '


    currently entering special characters returns nothing or strange results and entering the plain versin only matches the plain version.

    Does anyone have any suggestions?

    Example of SQL currently in use:

    SELECT * FROM table WHERE id != '' AND (MATCH title1 AGAINST ('ng') OR MATCH title2 AGAINST ('ng'))

  2. #2
    Join Date
    Aug 2004

    I haven't used MySQL full-text search, but I'm used to Oracle Text, and I think I understand your problem. I think you are facing two distinct issues :

    - It is normal not to retrieve words with special characters (such as '') when you try to replace these characters with standard ones (such as 'a' for ''), because the indexing was only done on the word with '', not the word with 'a'. MySQL may allow you to define rules such as ''='a' for indexing, but I doubt so. I believe that you will have to replace programmatically special characters with standard ones BEFORE indexing and BEFORE querying, so that you never insert or query with special characters.

    - If you get no result or strange results when querying with special characters, then I suppose you don't use the same character set when querying as the one you used when inserting (I speak of the client character set), hence a misinterpretation of special characters which are not converted the same way before being sent to the server.

    I hope it will help you a little.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts