Skip to main contentSkip to footer

Relevanssi Premium catches up with the free version with this release. As this version removes many bugs and fixes a vulnerability, it is highly recommended to all users.

  • Relevanssi now automatically treats ‘ß’ as ‘ss’. If your site has ‘ß’ in text, reindexing the database is a good idea.
  • Query variable post_status is now supported.
  • Improvements to excerpts: excerpts with phrases work much better now, and the excerpt creation logic has been improved: the excerpts are now better. The process takes a bit more time, though.
  • Allowing HTML tags in excerpts could lead to those tags being left open. Relevanssi will now try to close open HTML tags in excerpts.
  • Allowed tags were not controlled in comments. They are now.
  • Highlighting in documents didn’t always work; it should be more reliable now.
  • Non-integer values are removed from post__in and post__not_in before processing them.
  • Query variables p and page_id are now supported.
  • Relevanssi now understands date_query variables as well.
  • The original post excerpt is stored in $post->original_excerpt.
  • Taxonomy search works better with term id parameters (for example from wp_category_dropdown).
  • Errors about $wpdb->prepare() missing an argument removed.
  • New functions: relevanssi_the_title() and relevanssi_get_the_title() can be used to display highlighted titles in search results.
  • The old title highlighting method has been disabled, because it caused highlights in wrong places. Now the highlighted title is stored in $post->highlighted_post_title, take it from there or use the Relevanssi title functions to display it.
  • Polylang and WPML support was adjusted to perform better in edge cases.
  • Indexing is faster, thanks to some improved code from Tom Novelli.
  • MySQL injection attack vulnerability removed.
  • The cache feature is now removed. Relevanssi should automatically drop the cache tables.
  • New filter: relevanssi_indexing_data lets you modify the data before it’s indexed.
  • Fix for a bug that sometimes caused multisite hits to come from the wrong site.

Your account

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

Search

Popular Resources

ACF: Indexing relationship content

…know the exact field name. In that case you can use a direct database call to fetch fields using wild cards. This function would find a relationship field called people inside a flexible content field sidebar_groups: add_filter( ‘relevanssi_content_to_index’, ‘rlv_relationship_content’, 10, 2 ); function rlv_relationship_content( $content, $post ) { global $wpdb;…

Custom weighing with relevanssi_match and relevanssi_results

…$title_boost + $match->content + $match->comment * $comment_boost + $match->tag * $tag_boost + $match->link * $link_boost + $match->author + $match->category + $match->excerpt + $match->taxonomy + $match->customfield; $match->weight = $match->tf * $idf; Where $idf is the inverse document frequency, aka the rarity of the term in question. The bigger the weight, the…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 *……one week and halve the weight of posts older than that. add_filter( ‘relevanssi_match’, ‘date_weights’ ); function date_weights( $match ) { $post_date = get_the_time( ‘U’, $match->doc ); if ( time() – $post_date < WEEK_IN_SECONDS ) { $match->weight = $match->weight * 2; } else { $match->weight = $match->weight / 2; } return…

Forced phrase search with fallback

Relevanssi by default does not consider the search query a phrase, or value posts where the words in the search query appear together. Sometimes people do expect that, especially in AND searches. Relevanssi however does not have the information about the nearby words, so it’s not possible for Relevanssi to……factor that in. Relevanssi does support the sentence parameter in WordPress, which makes all searches phrase searches. It’s easy to enable: add_filter( ‘relevanssi_modify_wp_query’, ‘rlv_force_sentence’ ); /** * Enables the `sentence` parameter in Releavnssi queries. * * @param WP_Query $query The query object. * * @return WP_Query The modified query object….

Related Posts:

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