Skip to main contentSkip to footer

Looks like Relevanssi is compatible with WordPress 4.7, but one problem has been found so far: admin dashboard search for pages doesn’t work with Relevanssi. Other post types seem to work just fine. I wasn’t able to fix the problem, so this version circumvents it by disabling Relevanssi in the admin page search.

This version also fixes admin menu searching, which was broken with Relevanssi even before 4.7. There’s also a new feature that’ll make highlighting words with accented characters better. Pinning will also support multi-word search terms.

  • Relevanssi broke the WP admin menu search when admin searches were enabled.
  • Pinning now supports multi-word search terms.
  • Relevanssi broke the admin page search under WP 4.7. Relevanssi is now disabled in admin page searches.
  • The way accented characters are handled in highlighting is improved. A new filter, relevanssi_accents_replacement_arrays, can be used to adjust the accent replacement.

Get the new version from auto update or from the Download page.

Your account

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

Search

Popular Resources

Integrating Koko Analytics stats

…the weight calculations is straightforward. The best tool to use is the relevanssi_results filter hook. It lets us modify the weights of the posts. For each post, we calculate a weight multiplier based on the visitor stats and then multiple the weight of the post with that. I add some……= 1; } $relevanssi_koko_weights[ $post_id ] = $weight; } } return $relevanssi_koko_weights[ $post_id ] ?? 1; } add_filter( ‘relevanssi_results’, ‘rlv_koko_weights’ ); function rlv_koko_weights( $post_weights ) { foreach ( $post_weights as $post_id => $weight ) { $post_weights[ $post_id ] = rlv_koko_weight( intval( $post_id ) ) * $weight; } return $post_weights; }……$relevanssi_koko_weights[ $post_stats->id ] = $post_stats->visits; } $max_visits = max( $relevanssi_koko_weights ); $factor = $max_visits / 1000; // This controls the normalization. foreach ( $relevanssi_koko_weights as $post_id => $visits ) { $weight = $visits / $factor; if ( $weight < 1 ) { $weight = 1; } $relevanssi_koko_weights[ $post_id ] =…

Indexing term slugs

…Is this as expected? Is there anything I could do to change if it is? By default Relevanssi does not index the slug. You can use the relevanssi_content_to_index filter hook to solve this. Add this to your theme functions.php and rebuild the index, and you should be able to find……posts by slug. add_filter( ‘relevanssi_content_to_index’, ‘rlv_term_slugs’, 10, 2 ); function rlv_term_slugs( $content, $post ) { $tags = get_the_terms( $post->ID, TAXONOMY ); if ( false !== $tags ) { $tagstr = ”; foreach ( $tags as $tag ) { if ( is_object( $tag ) ) { $content .= $tag->slug . ‘……) { if ( is_object( $tag ) ) { $content .= $tag->slug . ‘ ‘; } } } return $content; } Replace TAXONOMY with the name of the taxonomy of the terms you want to index – post_tag for tags, category for categories and so on. Originally asked on WordPress.org….

Related Posts:

Currently there are no related posts available.

Comment Section:

4 Comments. Leave new

  • It looks like Relevanssi Premium 1.14.7 is now broken on pre-PHP 5.4 systems (e.g. CentOS 6, which uses PHP 5.3.3 and has 4 years of support left). Before you say “WordPress is for PHP 5.6 or later”, that’s the recommended PHP level – WordPress is stated to work on PHP 5.2.4 or later.

    The exact error on a CentOS 6 system is:

    PHP Parse error: syntax error, unexpected ‘[‘ in /wp-content/plugins/relevanssi-premium/lib/excerpts-highlights.php on line 531

    This is the new relevanssi_add_accent_variations() function that uses square bracket syntax for assigning array elements, that came in with PHP 5.4 I believe – see http://php.net/manual/en/language.types.array.php

    The fix is to use the array() syntax rather than the square bracket syntax. I’ll post this issue up via the support form as well, but I thought people might like to see it alongside the blog posting too.

    Reply
    • Thanks. Relevanssi Premium clients having problem with this can contact me via the support email, and I’ll help fix any issues caused by this.

      Reply
      • That’s fine for a short term fix, but will there be any plans to fix this for pre-PHP 5.4 systems in the next release of Relevanssi Premium? At the moment, I’m holding back updates to the latest version on 20-odd sites, which isn’t great.

        It’s not easy to upgrade PHP on CentOS 6 (the IUS repo gave me hope, but it broke too many sites for me because of the changes between 5.3.3 and 5.6.X). In some cases, I can move CentOS 6 sites to CentOS 7, but it’s a fair amount of work and still risks breakage.

        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