Skip to main contentSkip to footer

If you use utf8mb4 charset, Relevanssi database table may be missing an index. That’s because part of the index includes a column type that is of varchar(210) type. This is fine with utf8, but fails for utf8mb4, which only allows columns 191 characters long (because maximum column size is 767 bytes, and for 4-byte utf8mb4 characters that means 191 × 4 = 764 bytes).

To fix this, the column type needs to be shortened to varchar(191) and the index created again:

CREATE INDEX typeitem ON wp_relevanssi (type, item)

This seems to vary between servers; in some cases this fails and ends up with an error message, in some cases the index will automatically include only the first 191 characters of the column.

Also, if you shorten the column to 191 characters, you may run into problems if you have taxonomy slugs that are more than 191 characters long. Unlikely, yes, but something to be aware of.

Your account

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

Search

Popular Resources

Adding extra boost for exact title matches

…can use this code to give a boost for exact matches in titles and post content: add_filter( ‘relevanssi_results’, ‘rlv_exact_boost’ ); function rlv_exact_boost( $results ) { $query = strtolower( get_search_query() ); foreach ( $results as $post_id => $weight ) { $post = relevanssi_get_post( $post_id ); // Boost cases where query appears…Every now and then, somebody wants to see exact title matches higher in the results. Usually, the best way to do this is to increase the title weight, maybe switch the default operator to AND and let the Relevanssi algorithm lift the best results. If that is not enough, you……in the title if ( stristr( $post->post_title, $query ) !== false ) { $results[ $post_id ] = $weight * 100; } // Boost cases where query is exactly the title if ( strtolower( $post->post_title ) === $query ) { $results[ $post_id ] = $weight * 100; } // Boost query…

Gmedia photo gallery tags
Gmedia photo gallery gives a false impression of working with Relevanssi, as you can see the gmedia_tag taxonomy appear in…
Translation and multilingual plugins

Different translation plugins use different methods for storing the translations, and these methods have varying compatibility with how Relevanssi works with the posts. Best compatibility Polylang. Relevanssi has good built-in support for Polylang. This is the best translation tool that causes the least trouble. WPML. Good built-in support, almost as…

Related Posts:

Currently there are no related posts available.

Comment Section:

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