Continue reading Debugging Relevanssi searching issues

Debugging Relevanssi searching issues

Relevanssi has plenty of useful filter hooks you can use to debug problems. Here are some examples of how you can use the Relevanssi filter hooks to debug issues. Place the functions one at the time in the theme functions.php file and run a search to see results. Look at the parameters Relevanssi is getting…

Read more Debugging Relevanssi searching issues 0 Comment on Debugging Relevanssi searching issues
Continue reading WPML and category exclusions

WPML and category exclusions

Relevanssi category exclusion setting doesn’t work properly with WPML. Here’s a bit of code from Srdjan Jocić from OnTheGoSystems that fixes it. Just add this to your theme functions.php. add_filter( ‘relevanssi_search_filters’, ‘wpml_relevanssi_include_exclude_cats_fix’ ); function wpml_relevanssi_include_exclude_cats_fix( $args ) { if ( array_key_exists( ‘tax_query’, $args ) && did_action( ‘wpml_loaded’ ) ) {   foreach ( $args[’tax_query’] as…

Read more WPML and category exclusions 0 Comment on WPML and category exclusions
Continue reading Simple French plurals

Simple French plurals

If you have Relevanssi Premium and want to make Relevanssi understand French plurals, you can add this code to your theme functions.php: add_filter(’relevanssi_stemmer’, ‘relevanssi_french_plural_stemmer’); function relevanssi_french_plural_stemmer($term) { $len = strlen($term); $end1 = substr($term, -1, 1); if ("s" == $end1 && $len > 3) { $term = substr($term, 0, -1); } else if ("x" == $end1…

Read more Simple French plurals 2 Comments on Simple French plurals
Continue reading Indexing ACF relationship content

Indexing ACF relationship content

If your posts include content from related posts using the Advanced Custom Fields relationship functionality, Relevanssi doesn’t index that content by default. Even if you set Relevanssi up to index the ACF fields, the relationship fields do not include any content, just references to other posts. Those, even if indexed, are not particularly helpful. ACF…

Read more Indexing ACF relationship content 0 Comment on Indexing ACF relationship content
Continue reading Using AND and OR for Boolean operators

Using AND and OR for Boolean operators

Relevanssi Premium has support for in-query Boolean operators. Relevanssi uses + and – for the operators: cats -dogs and cats +kittens. If you prefer instead to use the verbal AND and OR operators, it only takes one small function in your theme functions.php: add_filter(’relevanssi_search_filters’, ‘rlv_boolean_operators’); function rlv_boolean_operators($args) { $args[’q’] = str_replace(’ and ‘, ‘ +’,…

Read more Using AND and OR for Boolean operators 0 Comment on Using AND and OR for Boolean operators
Continue reading Indexing ACF fields for taxonomy terms

Indexing ACF fields for taxonomy terms

Advanced Custom Fields makes it possible to add custom fields to taxonomy terms. If you set Relevanssi to index custom fields, Relevanssi won’t index these taxonomy custom fields, because taxonomy terms aren’t generally allowed to have custom fields and the default get_post_meta() function in WordPress doesn’t work on taxonomy terms. Getting the fields indexed requires…

Read more Indexing ACF fields for taxonomy terms 0 Comment on Indexing ACF fields for taxonomy terms
Continue reading SearchWP Live Ajax Search

SearchWP Live Ajax Search

Relevanssi doesn’t ship with a live search feature that would display results as the user types the search terms. There are many other plugins that provide this functionality, but few work with Relevanssi. SearchWP Live Ajax Search is the best one that does. It’s very easy to use, most of the time just install and…

Read more SearchWP Live Ajax Search 0 Comment on SearchWP Live Ajax Search
Continue reading Indexing and searching PDFs in WordPress

Indexing and searching PDFs in WordPress

Relevanssi Premium users have asked for PDF indexing since day one, and version 2.0 finally introduces this feature. Coming up with a method that is fast and reliable hasn’t been easy, but we’re pretty proud of what we have now. Our PDF indexer doesn’t tax your server as it runs as a service on a…

Read more Indexing and searching PDFs in WordPress 10 Comments on Indexing and searching PDFs in WordPress
Continue reading WP All Import compatibility

WP All Import compatibility

By default posts imported with WP All Import do not get indexed by Relevanssi. The importing process does not trigger Relevanssi indexing. That is, however, easy to remedy: add_action(’pmxi_saved_post’, ‘post_saved’, 10, 1); function post_saved($id) { relevanssi_index_doc($id, true, relevanssi_get_custom_fields(), true); }add_action(‘pmxi_saved_post’, ‘post_saved’, 10, 1); function post_saved($id) { relevanssi_index_doc($id, true, relevanssi_get_custom_fields(), true); } Add this code to…

Read more WP All Import compatibility 2 Comments on WP All Import compatibility