Available since: 1.6
searchwp_weight_threshold
By default SearchWP will consider any result that has a weight greater than zero (as defined by the keyword weights you have defined in the SearchWP settings). If you would like to increase the aggressiveness of the search algorithm by increasing the minimum weight accepted as a result you can add something like the following to your theme’s functions.php
:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_searchwp_weight_threshold() { | |
// only accept results with a weight of 10 or more | |
return 10; | |
} | |
add_filter( 'searchwp_weight_threshold', 'my_searchwp_weight_threshold' ); |