Disabling Relevanssi
If you need to disable Relevanssi, for example for a particular template, all you need to do is to unhook two filters: Before versions 4.10.2 (free) and 2.12.2 (Premium), you need to unhook these filters:
If you need to disable Relevanssi, for example for a particular template, all you need to do is to unhook two filters: Before versions 4.10.2 (free) and 2.12.2 (Premium), you need to unhook these filters:
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: This is not Relevanssi-specific and works just fine even without Relevanssi. If you are using Relevanssi on a multisite system, you need a small change to…
On one of our sites we have 2 search boxes, one where you can do a normal search and the other where you can search for employees or departments. The employees/department search is done by using the relevanssi_do_query() function. Can we use fuzzy matching on the normal search and disable it on the employees/department search?…
Usually, WordPress supports one category, one tag and one taxonomy in the search, if you use the query variables to set the taxonomies. You can enter multiple taxonomies as parameters to the query, but only the first one is used. If you want to have multiple taxonomies involved, you need to build a tax_query. The…
Hello, I’m using WooCommerce and Relevanssi and they work great. My Site Search only searches Products, however I want to let certain posts appear in the search results. Is there a way to allow certain posts to be in the results? Yes. There are many ways to do this, and the best way depends on…
If Relevanssi Premium causes out-of-memory problems, make sure you have the “Throttle searches” option checked. However, if that doesn’t work and you’re still getting out of memory issues, you can try making the throttle tighter. The limit can be adjusted by adding this line to your site: If necessary, you can adjust the value (250)…
Deprecated: Relevanssi has long supported searching without a search term. These instructions are not necessary. Version 1.7.3 introduces the possibility to use Relevanssi without a search term. This is useful when you have extra query arguments that can be used to narrow the search, but which would be useful without a search term present. This…
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: Where $idf is the inverse document frequency, aka the…