Skip to main contentSkip to footer

By default, the search ignores German umlauts. Searching for “uber” will also find “über” and so on. This ignorance is not a Relevanssi feature but instead governed by your database. The default database collation WordPress uses (utf8mb4_unicode_ci) ignores all accents, including umlauts.

wp_relevanssi database table, with collation set to utf8mb4_unicode_ci

If you want the search to care about umlauts, you can change the collation. For German, use utf8mb4_german2_ci (actually, use utf8mb4_swedish_ci, see comments below):

wp_relevanssi database table, with collation set to utf8mb4_german2_ci

Now, the database will not ignore umlauts. Relevanssi also removes accents to match what the database does, so you must also undo that. Add this to your site:

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

Once you’ve done these steps, rebuild the index. Now, the search should not ignore the umlauts.

Your account

Not logged in. Log in to see your license details.

Search

Popular Resources

Using Relevanssi without a search term
Deprecated: Relevanssi has long supported searching without a search term. These instructions are not necessary. Version 1.7.3 introduces the possibility…
Popular searches

This is a very common request: “How do I show the most popular searches in a widget or on a page?” Relevanssi does not have such a feature built in, and the reason for that is twofold: First, on many sites, the most common searches are either spam or boring….…that. So, for these two reasons Relevanssi doesn’t ship with a “popular searches” widget. Creating one in itself would not be difficult. This code snippet, for example, creates a very simple popularsearches shortcode. The shortcode will display the five most common search terms. add_shortcode( ‘popularsearches’, function() { global $wpdb, $relevanssi_variables;…

Using AND and NOT for Boolean operators

Relevanssi Premium has support for in-query Boolean operators. Relevanssi uses + and – for the operators: cats -dogs and cats +kittens. If you prefer instead to use the verbal AND and NOT operators, it only takes one small function. Add this to your site: add_filter( ‘relevanssi_search_filters’, ‘rlv_boolean_operators’ ); function rlv_boolean_operators(

Related Posts:

Comment Section:

1 Comment. Leave new

  • Sorry, but the info “If you want the search to care about umlauts, you can change the collation. For German, use utf8mb4_german2_ci” is WRONG.

    You need to use utf8mb4_swedish_ci, like always.
    It might have worked in some specific use case, but with any other current MySQL or MariaDB server, swedish_ci is the better option, as you will ACTUALLY get umlauts – as one expects – in the term column.

    I repeat: NO, DO NOT use utf8mb4_german2_ci, because that doesnt store umlauts. Yes, it allows for querying anything with “ue” as if it was “ü”, but it DOES NOT STORE words with umlauts, sz-ligature.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed