Available since: 2.9
searchwp_weight_max
View Parameters »SearchWP’s algorithm is based on the concept of weight. We can think of weight as a way to give a numeric value to the relevance of a result. The more weight the higher the relevance the higher it will appear on a results page.
The default maximum weight in the engine configuration UI is 100
, you can use the searchwp_weight_max
filter to change that like so:
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 | |
// Increase the maximum available SearchWP weight to 500 | |
function my_searchwp_weight_max( $weight ) { | |
return 500; | |
} | |
add_filter( 'searchwp_weight_max', 'my_searchwp_weight_max' ); |
Parameters
Parameter | Type | Description |
---|---|---|
$weight |
Integer |
The maximum weight available in the engine configuration UI |