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

WP Download Manager

…these issues. When you upload the files to the Relevanssi attachment reading server, Relevanssi uses the get_attached_file() function to get the file name, but that does not work with WP Download Manager. Thus we need to use the relevanssi_get_attached_file filter hook to provide the file name and path for Relevanssi….…add-on adds an advanced search with the [wpdb_archive_filter] shortcode. That search does not use Relevanssi by default, but it can be modified to make use of Relevanssi with this little function you can add to your site: add_filter( ‘wpdm_packages_query_params’, ‘rlv_use_relevanssi’ ); function rlv_use_relevanssi( $params ) { if ( isset( $params[‘s’]…

Indexing attachment file names
Relevanssi has been working nicely for the normal usecase. But how does one setup indexing of attachment files. When someone…
Automatic redirects to category archives

…This function runs on the saved_term action hook, which triggers whenever a taxonomy term is saved. It checks your redirects and adds missing product_cat category redirects. This will make sure your redirection settings are always up to date. To create the first redirects, you need to add this function to……wp_list_pluck( $redirects, ‘url’ ); foreach ( $product_cats as $cat ) { $url = get_category_link( $cat->term_id ); if ( ! in_array( $url, $existing_redirects, true ) ) { $redirects[] = array( ‘url’ => $url, ‘query’ => $cat->name, ‘partial’ => false, ‘hits’ => 0, ); } } update_option( ‘relevanssi_redirects’, $redirects ); } );……This will make sure your redirection settings are always up to date. To create the first redirects, you need to add this function to your site and then save a product category term. This does not remove redirects for non-existing categories, so that is something you need to maintain manually….

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