Skip to main contentSkip to footer

The new versions include a couple of new filter hooks that are not of big interest to most users but may be helpful for specific needs.

The biggest change in this version is how the stopwords page works: now it is possible to remove all stopwords without having the stopword list automatically repopulate from the default stopwords. Now there’s an “Add default stopwords” button that does that. If you are upgrading from an older version of Relevanssi and notice your stopwords missing, clicking the “Add default stopwords” should restore your old stopwords.

Known issues

  • Multisite search can include posts from archived sites in the results.
  • Content stopwords aren’t applied to the attachment file content. Fix here.
  • 2.6.1 broke WP 4.9 compatibility.
  • User Access Manager makes drafts appear in search results. Fix here.

Version 2.6.2 is coming soon with fixes for these issues.

Version 2.6.1

  • When using Gutenberg, pinning only works with posts, not with other post types. Version 2.6.1 fixes this so that pinning works in all indexed post types.

New features

Changed behaviour

  • Premium: The relevanssi_related_words filter hook didn’t get the post ID as parameter, which severely constricts its usability. That’s now fixed: the filter gets the post ID as the second parameter.
  • Stopwords are no longer automatically restored if emptied. It’s now possible to empty the stopword list. If you want to restore the stopwords from the file (or from the database, if you’re upgrading from an earlier version of Premium and find your stopwords missing), just click the button on the stopwords settings page that restores the stopwords.
  • Changes to post weights in the relevanssi_results hook did not affect the relevance scores shown in excerpts. That’s changed now, and the displayed scores are now taken from the $doc_weight array, which is returned in the return value array from relevanssi_search().
  • Mostly Premium: Excerpt length and type are now checked outside the loop that goes through the posts. This reduces the number of database calls, but the most important effect is that now multisite searches will always create the excerpts with the settings of the subsite where the search is made and not with the settings of the subsite of each post.

Minor bug fixes

  • Searching for regex special characters (for example parentheses, brackets) caused problems in excerpts.
  • Premium. Phrase matching wasn’t applied to PDF content if the “Custom fields to index” setting was set to “some”.
  • Premium. Indexing taxonomies from the WP CLI could leave old taxonomy terms in the index. This is now prevented.
  • Improvements in handling highlighting for words with apostrophes.
  • Disregard hanging commas at the end of post exclusion settings.
  • Premium. Relevanssi was blocking post queries in WP CLI. That’s now fixed.
  • Sometimes excerpts wouldn’t have an ellipsis in the beginning even though they should.
  • Premium. The ‘Add a redirect’ button did not work if there were no redirects.

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.

Your account

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

Search

Popular Resources

Proximity sorting

…post. You give the location with the relevanssi_proximity_coordinates filter hook, which filters the coordinates and gets the post ID as the parameter. Often the coordinates are in a custom field. The necessary function will look something like this: add_filter( ‘relevanssi_proximity_coordinates’, function( $coordinates, $post_id ) { return get_post_meta( $post_id, ‘coordinates’, true……on the relevanssi_proximity_comparison filter hook. That function should return the coordinates as a string. If you don’t use the coordinates query variable, you need this snippet to remove a PHP warning: add_action( ‘init’, function() { remove_filter( ‘relevanssi_search_params’, ‘relevanssi_pick_up_coordinates’ ); } ); Then you need to provide the coordinates for each……a fixed spot or something the search user provides. Relevanssi looks for this in the coordinates query variable and it should have the coordinates in the “latitude, longitude” format. If this is not possible or easy, you can also provide the coordinates with a filter function. Add a filter function…

Debugging with Query Monitor

Query Monitor is by far the best thing for a WordPress developer. It’s billed as the “Developer Tools panel for WordPress”, and that’s a good way to put it. If you’ve ever used the browser developer tools, you know what to expect. Query Monitor is a good way to figure……Clicking the admin bar output opens up the Query Monitor panel and from there, you can access all sorts of information. When debugging Relevanssi searching issues, we’re mostly interested in the Queries part, and you can set the “Caller” to relevanssi_search() to exclude all non-Relevanssi queries. The highlighted query that…

Custom weighing with relevanssi_match and relevanssi_results

The relevanssi_match hook lets you modify the matches found for queries. It passes a match object, which has the post id ($match->doc), number of hits found in different parts of the post and the weight assigned to the post ($match->weight). Here’s how Relevanssi calculates the weight: $match->tf = $match->title *…

Related Posts:

Comment Section:

5 Comments. Leave new

  • Hi,

    we are premiums users and wanted to upgrade, but I think 2.6.1 has (still) problems with WP 4.9:

    ( ! ) Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘relevanssi_register_gutenberg_actions’ not found or invalid function name

    The callback is defined in lib/compatibility/gutenberg.php which is required conditionally in lib/init.php only if the function “do_blocks” is existing.

    Can you fix that in a new minor release?

    Kind Regards
    Martin

    Reply
  • Hello,

    I am having an issue with the plugin causing a duplicate sql entry.
    I came across another user with the same issue: https://www.relevanssi.com/release-notes/free-3-1-6/

    I have tried removing the plugin and reindexing but the error remains.

    The conditions in which I’m getting the error is when I’m pushing the website from live to a staging server. The mysql dump is failing due to the duplicate entry error.

    This is the exact error message:
    ERROR 1062 (23000) at line 673: Duplicate entry ‘41432-???-0’ for key ‘doctermitem’

    Is it viable for us to remove this line:
    UNIQUE KEY `doctermitem` (`doc`,`term`,`item`),

    or to rename it; or if you have an other suggestions in actions we can take to resolve.

    Thanks.

    Reply
    • Can you set up the push to the staging so that the Relevanssi database table is not pushed? There’s relatively little point in pushing the data over, because you can always rebuild it at the other end.

      Since the database has a unique key, it shouldn’t have duplicate data in the first place, so you may also want to look at the database settings – do the character set settings match? Maybe not, if keys that are working in the other end become corrupted and duplicates on the other end.

      If nothing else helps, just remove the data causing the problem. Either manually remove the offending data, or truncate the Relevanssi database before the push.

      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