Posted on

Premium 2.8 / Free 4.7

These versions add new features, but these are mostly small and of interest to developers. As a big change Relevanssi is now active in Media Library searches in the admin backend (if admin searches are enabled): feedback on this is welcome.

Excerpts should be slightly better, especially when content stopwords are involved and post part targeting is more precise.

Known issues

  • Nothing at the moment.

2.8.2 / 4.7.2

  • Using phrases in the post part targeting didn’t work well correctly. It’s much better now. There may still be weird edge cases; please report any issues.
  • Relevanssi will be automatically disabled in Media Library searches is the attachment post type is not indexed or if the image attachment indexing is disabled.
  • Relevanssi now checks your existing relevanssi_indexing_restriction filter functions and will report broken functions in the Indexing tab of Relevanssi settings.

2.8.1 / 4.7.1

  • The change in the relevanssi_indexing_restriction filter hook caused more problems with existing filters than expected, despite the measures to add backwards compatibility. This version adds more backwards compatibility to make existing old-style filter functions work better.
  • New filter hook relevanssi_post_content_after_shortcodes lets you filter the post content after shortcodes have been expanded, but before the HTML tags are stripped.

New features

  • New filter hook relevanssi_block_to_render makes it possible to filter Gutenberg blocks before they are rendered to HTML.
  • New filter hook relevanssi_admin_search_blocked_post_types makes it easy to block Relevanssi from searching a specific post type in the admin dashboard. There’s built-in support for Reusable Content Blocks rc_blocks post type, for example.
  • Premium: Relevanssi metabox and the Gutenberg sidebar now show the reason why a post is not indexed. You can find the reason at the “How Relevanssi sees this post” feature.
  • Free version users can find the reason for not indexing the post in the _relevanssi_noindex_reason custom field.
  • When creating excerpts Relevanssi tries to remove the disabled shortcodes.

Changed behaviour

  • Relevanssi has been blocked in the admin Media Library searches since 2012. There seems to be no reason not to use Relevanssi there, so Relevanssi is now used for admin Media Library searches, if admin searching is enabled in the first place.
  • Relevanssi now applies minimum word length when tokenizing search query terms.
  • Premium: Content stopwords are removed from the search queries when doing excerpts and highlights. When Relevanssi uses the untokenized search terms for excerpt-building, stopwords are removed from those words. This should lead to better excerpts.
  • The relevanssi_indexing_restriction filter hook has a changed format. Instead of a string value, the filter now expects an array with the MySQL query in the index mysql and a reason in string format in reason. There’s some temporary backwards compatibility for this.

Minor fixes

  • Premium: Synonym indexing for AND searches didn’t work for taxonomy terms.
  • Premium: Post part targeting didn’t work well with partial matching or numeric search terms.
  • Using post_parent from the URL parameters didn’t work.
  • Premium: Improves handling of content stopwords in partial matched searches.
  • Premium: Polylang filtered out users and taxonomy terms from the results in some cases. That’s still implemented in a fairly hackish way, but it’s been made more robust now.
  • Improves handling of emoji in indexing. If the database supports emoji, they are allowed, otherwise they are encoded.
  • Premium: The relevanssi_words option no longer autoloads (it’s a big one).

The free version is available from the WordPress plugin repository. You can get the Premium version from the Download page or with the automatic update.

The download page shows two different versions of the plugin available. The basic version no longer includes tests or anything else you won’t need when actually using the plugin. The developer version includes tests and all sorts of other tooling you may find interesting if you’re a developer.

2 comments Premium 2.8 / Free 4.7

  1. Hi,

    I got an error after updating to premium 2.8:

    Uncaught Error: Cannot use assign-op operators with string offsets in /home/provgr/domains/[mydomain]/public_html/app/plugins/relevanssi-premium/lib/compatibility/yoast-seo.php: 46

    I found that this filter (mentioned on https://www.relevanssi.com/knowledge-base/controlling-attachment-types-index/) causes the error:
    add_filter( ‘relevanssi_indexing_restriction’, function( $restriction ) {
    global $wpdb;
    $restriction .= ” AND post.ID NOT IN (SELECT ID FROM $wpdb->posts WHERE post_type = ‘attachment’ AND post_mime_type LIKE ‘image%’ ) “;
    return $restriction;
    });

    How to fix it?

    1. This filter was changed (as described in the changelog above). Change

      $restriction .= ” AND post.ID NOT IN (SELECT ID FROM $wpdb->posts WHERE post_type = ‘attachment’ AND post_mime_type LIKE ‘image%’ ) “;

      to

      $restriction['mysql'] .= " AND post.ID NOT IN (SELECT ID FROM $wpdb->posts WHERE post_type = 'attachment' AND post_mime_type LIKE 'image%' ) ";
      $restriction['reason'] .= ' No images';

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.