Exclude certain characters of the search

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Exclude certain characters of the search

This topic contains 2 replies, has 2 voices, and was last updated by Olivier Lecomte Olivier Lecomte 6 years, 11 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #5797
    Olivier Lecomte
    Olivier Lecomte
    Participant

    Thank you for your great plugin !

    I use the plugin in French (version 4.5.1 the latest version ),
    and I have a problem with special characters for example :
    – dabord
    our
    –lactivité
    The character is blocking the search.

    But the word “abord” or ” activité” only works well !

    There is there a way to exclude certain characters of the research?

    Thank you

    #5800
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    I think you are using a different apostrophe character there.

    If you try the l’activité or d’abord it’s going to work.
    The ’ apostrophe is not same character as the ‘.

    I’ve logged in with the FTP account and created a filtering function to replace the incorrect apostrophe automatically for you. It took me a while, because the functions.php file was in an incorrect encoding, but I fixed that for you as well. The code I appended there for future reference:

    
    // An extra function for fixing the apostrophes for Ajax Search PRO
    add_filter('asp_search_phrase_after_cleaning', 'asp_fix_apostrophe', 1, 1);
    
    function asp_fix_apostrophe( $s ) {
      $s = mb_ereg_replace("'", "’", $s);
      return stripslashes($s);
    }
    

    This code remains after updates as well, you don’t have to worry 🙂

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #5801
    Olivier Lecomte
    Olivier Lecomte
    Participant

    Thank you so much for your great support !!! Big up !

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.