Support » Plugin: Relevanssi - A Better Search » How to get æ to work?

  • Resolved pstidsen

    (@pstidsen)


    Hi there,

    Searching for “Strygemærke” gives no results. However, searching for “Strygem” gives hits with the word “Strygemærke” in the title. I guess, it’s beacuse of the Danish letter “æ”. How can we get Relevanssi to handle “æ”?

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mikko Saari

    (@msaari)

    There’s something weird going on in your site. Usually, “strygemærke”, “strygemaerke” and possibly even “strygemarke” should all return those posts.

    First of all, rule out problems with that AJAX search of yours. How does the Relevanssi admin search (Dashboard > Admin search) work? Does it find the posts if you search for “strygemærke” or “strygemaerke”? If you look at those posts with the Relevanssi debugger, how is the product title indexed?

    Anyway, the correct solution depends on your database settings. Which collation is your wp_relevanssi database table using? Default utf8mb4_unicode_ci or something Danish?

    Thread Starter pstidsen

    (@pstidsen)

    Hi Mikko,

    Thanks for the quick reply. Admin search doesn’t work either: https://www.screencast.com/t/HVJswHcG – and not for “strygemaerke” as well.

    The debugging indexing is here: https://www.screencast.com/t/dMTCFzL7M3

    Here you see the db setting: https://www.screencast.com/t/DzpKr1Nr and for the table: https://www.screencast.com/t/ifH7NqBwWjlC

    Plugin Author Mikko Saari

    (@msaari)

    Is the collation the same for the wp_relevanssi database table for the term and term_reverse columns?

    Looks like the utf8mb4_unicode_520_ci does recognise æ as a separate letter, so try adding this to your site:

    remove_filter( 'relevanssi_remove_punctuation', 'remove_accents', 9 );

    Add this to a snippet or in the theme functions.php and then rebuild the index. Does that help?

    Thread Starter pstidsen

    (@pstidsen)

    Hi there,

    The collation looks like this: https://www.screencast.com/t/mPnddNFyCM for the wp_relevanssi table.

    Removing the filter solves the issue. Does it have any disadvantages?

    Plugin Author Mikko Saari

    (@msaari)

    There are no disadvantages to it.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to get æ to work?’ is closed to new replies.