Get Latest GPL & Premium Version Blogger Template, WordPress and WooCommerce Extensions...
Home » Plugins » FacetWP Relevanssi integration
Description

FacetWP Relevanssi integration

Integrate search facets with the Relevanssi search plugin. Relevanssi greatly improves the quality and relevancy of search results by maintaining its own search index in the database.

Integrate with the Relevanssi plugin

Setup

Because of the way Relevanssi plugs itself into WordPress core search, the Relevanssi add-on integration must be installed when you use FacetWP together with Relevanssi. Without the add-on, Search facets and the site-wide search results page will not work correctly.

How to select the Relevanssi search engine the Search facet settings.
How to select the Relevanssi search engine the Search facet settings.

When the Relevanssi add-on is activated, each Search facet will show a new “Relevanssi” option within its “Search engine” settingThis new “Relevanssi” engine must be selected, otherwise the facet will return no results. If you have reasons to want to use the “WP Default” engine instead, the only way to make this work is to disable Relevanssi on the page where the Search facet is placed.

If your site-wide search results page (the page with /?s=searchterm in the URL) has facets, the above is all you need to do. But if it does not have facets, the search result page will not show results. To fix this, you need to disable FacetWP on the search results page.

Turn off results snippets

Some users have reported issues with Relevanssi’s “Create custom search result snippets” feature.

If your results don’t show, try disabling that setting, as demonstrated below:

Disable Relevanssi's Create custom search result snippets setting.
Disable Relevanssi’s “Create custom search result snippets” setting.

Relevanssi limits

Be aware that using Relevanssi may require large amounts (hundreds of MBs) of database space (for a reasonable estimate, multiply the size of your wp_posts database table by three). If your hosting setup has a limited amount of space for database tables, using Relevanssi may cause problems. The following information is from the Relevanssi site:

“The upper limit of how big a site Relevanssi can support depends on your hardware. On shared hosting accounts with limited resources, tens of thousands of posts can be too much. If your hardware is solid, especially your database, there’s probably no upper boundary. The biggest site we’ve heard run Relevanssi without problems had two million posts, using a dedicated database server with SSD drives.”

Fix “no results” on the search results page

If you have the FacetWP Relevanssi integration add-on installed, and your search results page (the page with /?s=searchterm in the URL) does not have facets, the search will not work properly and show no results.

This is caused by FacetWP’s integration having to intercept the search query before it can know if facets are being used on the page. To fix this issue, you have to disable FacetWP for the search results page only, by adding the following code to your (child) theme’s functions.php:

How to use custom PHP code?

PHP code can be added to your (child) theme’s functions.php file. Alternatively, you can use the Custom Hooks add-on, or a code snippets plugin. More info

add_filter( ‘facetwp_is_main_query’, function( $is_main_query, $query ) {
if ( $query->is_search() && $query->is_main_query() ) {
$is_main_query = false;
}
return $is_main_query;
}, 5, 2 );

Using Relevanssi with WooCommerce

If you are using Relevanssi together with WooCommerce, some things will not work immediately.

This article in the Relevanssi documentation gives a good overview of common compatibility issues and their fixes.

Fix search results for WooCommerce product SKUs

If you are using Relevanssi with WooCommerce, with product variations enabled, you may run into issues when searching variation product SKUs with the Search facet.

Relevanssi can index product and product variation SKUs for WooCommerce products: just add _sku to the list of custom fields to index. But Relevanssi will index SKUs for the variations only, so the parent product will not be found when searching for the variation SKU.

The following code (source) uses the relevanssi_content_to_index filter hook to index the product variation SKUs for the main product, so you will be able to find the parent product when searching for the variation SKU.

Add this code to your (child) theme’s functions.php, rebuild the Relevanssi index and re-index FacetWP:

How to use custom PHP code?

PHP code can be added to your (child) theme’s functions.php file. Alternatively, you can use the Custom Hooks add-on, or a code snippets plugin. More info

add_filter( ‘relevanssi_content_to_index’, ‘rlv_index_variation_skus’, 10, 2 );
function rlv_index_variation_skus( $content, $post ) {
if ( ‘product’ === $post->post_type ) {
$args = array(
‘post_parent’ => $post->ID,
‘post_type’ => ‘product_variation’,
‘posts_per_page’ => –1
);
$variations = get_posts( $args );
if ( ! empty( $variations ) ) {
foreach ( $variations as $variation ) {
$sku = get_post_meta( $variation->ID, ‘_sku’, true );
$content .= $sku;
}
}
}
return $content;
}

How to disable Relevanssi on certain pages

If you need to disable Relevanssi on specific pages or templates, all you need to do is unhook two Relevanssi filters. To do so, add the following code to your (child) theme’s functions.php. If you want to apply this code only to specific pages or templates, use a Conditional Tag. In this example the code is only applied to a page with ID 4814.

With this code in place, it is also possible to use the “WP Default” Search engine setting in Search facets when you have Relevanssi installed, which normally does not work.

How to use custom PHP code?

PHP code can be added to your (child) theme’s functions.php file. Alternatively, you can use the Custom Hooks add-on, or a code snippets plugin. More info

add_action( ‘wp_head’, function() {
if ( is_page( 4814 ) ) { // Optionally limit this code to a specific page or template, with a Conditional Tag.
// Disable Relevanssi entirely
remove_filter( ‘posts_request’, ‘relevanssi_prevent_default_request’ );
remove_filter( ‘posts_pre_query’, ‘relevanssi_query’, 99 );
}
} );

Change the minimum word length

By default, Relevanssi does not index words shorter than three characters. So search terms with less than three characters will not return any results in Search facets that use the Relevanssi engine.

You can change this with the “Minimum word length” setting. To find this setting, navigate to
Settings > Relevanssi > Indexing, then scroll down to “Advanced indexing settings”, then click “Show advanced settings”:

How to change Relevanssi's minimum word length.
How to change Relevanssi’s minimum word length.

After making changes to this setting, make sure to rebuild Relavanssi’s index.

If you want to allow one-letter searches, you can do so with the “relevanssi_block_one_letter_searches” hook:

How to use custom PHP code?

PHP code can be added to your (child) theme’s functions.php file. Alternatively, you can use the Custom Hooks add-on, or a code snippets plugin. More info

add_filter( 'relevanssi_block_one_letter_searches', '__return_false' );

Note that (according to the above-linked documentation) this filter does not work if fuzzy matching is enabled (in Settings > Relevanssi > Searching > Keyword matching > “Partial words”).

WordPress theme,

WordPress plugin,

Woocommerce,

GPL Plugins WordPress,

GPLplugins,

Free WordPress plugins,

Free Woocommerce Plugins,

Reviews (0)
0 reviews
0
0
0
0
0

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

READ FIRST

Our business hours are Monday to Friday from 10:00 am to 4:00 pm (GMT-8), any request made outside these hours will be process until next business day. Support and Updates can take 24 to 48 hours. Support provided is for product installation. Please be aware of possible time zone differences when waiting for our reply.

Updates:
  • To receive an email notification when products have been updated, be sure to click on the notification button below the product image.
  • On a standalone item, you will get lifetime updates. If you choose a membership, updates and access to your items will be available as long as your membership is active.
  • We regularly update products as soon as we are notified about an update, we go and download it from the author and update it on our site, but In case the current version of the product is not the latest, You can request an update for the product.
  • We send regular emails advising when products have been updated so please be sure to provide an active email address when you sign up.
Support:
  • If you have any question or need help installing products purchased on our website, please don’t hesitate to contact us.
  • Please note that we are not developers of the provided products, so our technical support capabilities are limited. We do not change product functionality and do not fix developer bugs.
  • We don’t offer any additional author services like author’s support and license keys and we are not affiliated or in any way related to third-party developers or trademark owners. If you want to know more about GNU / GPL License, CLICK HERE.
Abuse Warning:
  • Please note that accounts are monitored and redistribution of our content is not allowed and will not be tolerated.
  • Our system may detect patterns of downloading items from non-end users outside of our fair use policy.
  • Any violation of our terms of use will result in permanent account suspension and no refunds will be issued.
  • Subscriptions can be cancelled at any time from your account control panel.
  • Downloads are strictly subject to our fair use policy.
For more information please read FAQs & Terms of Service.
FOR DAILY UPDATES & SUPPORT
FOLLOW US HERE
Activation

NOTE: 

  • All The Products Are From Original Author
  • All The Files Would Be Untouched And Unmodified
  • Unlimited Website Usage
  • Files Scanned By Norton And Mcafee
  • Free New Version
  • License : GPL
FOR DAILY UPDATES & SUPPORT
FOLLOW US HERE

FacetWP Relevanssi integration

VERSION 0.8.2
UPDATED 10 May 2024
LICENSE GPL
DEVELOPER FacetWP
SOFTWARE WordPress
TYPE Plugin

Original price was: €69.00.Current price is: €1.83.

All the plugins and themes on gplplugins.site are released under the GPL (General Public License) license. It is 100% legal for us to redistribute the products to you. It is completely safe, legal, and legit.

This is the original file from the developer, not modified, not nulled and not malware.

FOR DAILY UPDATES & SUPPORT
FOLLOW US HERE

RELATED PRODUCTS

Shopping cart
Shop
0 items Cart
My account