Does the search work correctly without Search & Filter? If you try the Relevanssi admin search at Dashboard > Admin search, for example.
Is the throttle enabled? Throttle and date sorting isn’t always a good match.
Hi Mikko – many thanks for the quick reply!
Turning off the throttling seems to have worked but I will need to check with my client to make sure it works as they expect. In terms of performance – are there any potentail issues in turning it off?
As a quick aside, https://safelyhome.com/death-notice/?_sf_s=McGirr works as expected but a space bwteen Mc and Girr (i.e https://safelyhome.com/death-notice/?_sf_s=Mc%20Girr) doesn’t. Is there any way to make the results appear with the space in place?
Thanks!
I don’t think turning off the throttle will be a huge problem. How big is your database, how many posts do you expect a biggest result set could be approximately?
If you enable partial matching in Relevanssi settings, “Girr” finds “McGirr”. That would help but will also increase false matches. You can also add a filter that would fix all cases of “Mc”-space-something by removing the space.
Hi Mikko – posts are sitting around 48k+ with a database size of 1.66GB.
Average result should hopefully be ono more than 100 posts (depending on the popularity of the name).
In terms of adding a filter – how would I go about doing this?
Thanks!
That’s a lot of posts, but if the result sets are generally that small, it should not be a problem.
add_filter( 'relevanssi_remove_punctuation', function( $str ) {
$str = preg_replace( '/(mc)\s(.*)/i', '\1\2', $str );
return $str;
}, 9 );
This filter will convert all “mc something” to “mcsomething”. Add this to your theme functions.php or in a code snippet plugin and rebuild the index.
Hi Mikko – perfect. Thanks for your help! Very much appreciated!
Hi Mikko – apologies. Is there a filter that if someone types in McGirr that results that are spelt Mc Girr appear also? I tried setting to OR in settings but it increased the number of false positive readings.
it’s the same filter, but you need to rebuild the index before it takes effect that way. The filter makes ”McGirr” and ”Mc Girr” the same, and it applies both to search terms and posts.