Skip to main contentSkip to footer

Quite a few changes in this version, both fundamental changes in the structure of the plugin and small bug fixes and something in between.

  • New database structure, which probably reduces the database size and makes clever stuff possible.
  • The throttle option had no effect, throttle was always enabled. Now the option works. You can now also either replace the throttle function with your own (through ‘relevanssi_query_filter‘) or modify it if necessary (‘relevanssi_throttle’).
  • Highlights didn’t work properly with non-ASCII alphabets. Now there’s an option to make them work.
  • Title highlight option now affects external search term highlights as well.
  • Stopwords are not highlighted anymore.
  • Fixed a small mistake that caused error notices.
  • Custom post types, particularly those created by More Types plugin, were causing problems.

Lots of stuff with highlights, mostly with fairly obvious results. The database stuff is important and requires a reindexing after the update to make things work.

Now each occurrence of a word in a document gets one row in the database, previously this created several rows: one for post content, one for the title, one for tags and so on. This solution reduces the number of database rows and makes things that much smoother (and makes the throttle, for example, much better). It also offers quite a few interesting possibilities for future development.

Since this is a fairly big change, I expect there are some bugs or at least unforeseen consequences. Please let me know if you notice anything unusual.

Your account

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

Search

Popular Resources

Auto-redirecting with one search result

If you want to auto-direct the user directly to the result if there’s just one result for the search, that’s quite easy. Add the following code to your site: add_action( ‘template_redirect’, ‘one_match_redirect’ ); function one_match_redirect() { if ( is_search() ) { global $wp_query; if ( 1 === $wp_query->post_count ) {…

Search results in random order

Do you want to order your search results in random order? Here’s how: add_filter( ‘relevanssi_hits_filter’, ‘shuffle_search’ ); function shuffle_search( $hits ) { shuffle( $hits[0] ); return $hits; } Add this function to your site and the search results will appear in random order. You can also do this: add_filter( ‘relevanssi_modify_wp_query’,…

Showing the number of search results

…$wp_query->found_posts . ‘ hits.</p>’; ?> in your search results template. In case that produces no results, try introducing the global $wp_query variable like this: <?php global $wp_query; echo ‘<p>Found ‘ . $wp_query->found_posts . ‘ hits.</p>’; ?> The usual method which involves a new WP_Query object does not work with Relevanssi….

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