When fixing weights, it’s best to use the Relevanssi admin search (Dashboard > Admin search). That will show you the exact weights Relevanssi has calculated for the posts. That will show you whether the results are sorted by weight or not.
The results for “cpu” on your site seem pretty decent for me, but I don’t know what the expected result is.
In any case, your weight multipliers are fairly low. If you want tag matches ranked higher, increase their weight more. Also note that “cpu” on your site is not a post_tag but a product_tag tag, so adjusting the “Tag weight” in Relevanssi settings doesn’t do anything, because it only applies to post_tag tags, not for any other taxonomies.
This is a limitation in the free version of Relevanssi. Relevanssi Premium has a setting for “Posts tagged with taxonomy ‘product_tag'”, which is what you’d need here. Adding weight for custom taxonomies is more complicated in the free version of Relevanssi and requires code. This might help a bit:
add_filter( 'relevanssi_match', 'rlv_product_tag_boost' );
function rlv_product_tag_boost( $match ) {
if ( $match->taxonomy > 0 ) {
$match->weight = $match->weight * 5 * $match->taxonomy;
}
return $match;
}
what is this code supposed to do ?
increase the weight of product tags ?? thats it
and what is the amount of increasing ?
what is the features in the premium version ? i can put a weight for any taxonomy ?
With this code, Relevanssi checks each match it finds (ie. when a search term matches a document). If the match is made in any taxonomy, the weight of the match is increased. This will lead to boosting the product_tag matches. It also boosts other custom taxonomies, which may or may not be a problem.
In Premium, you’ll have a setting on the settings page where you can directly adjust the weight of the product_tag taxonomy like you can adjust the regular tags in the free version.