Relevanssi stores the relevance score it uses to sort results in the $post
variable. Just add something like
<?php echo "Score: $post->relevance_score"; ?>
to your search results template to display the relevance score.
Related Posts
Filter hooks
Relevanssi has lots of filter hooks you can use to modify how the plugin behaves. Most of these are pretty advanced and an average user probably doesn't have to worry about them, but if you're going t...
Installing Relevanssi and adjusting the settings
Installing Relevanssi is simple. For free version, install the latest version of the plugin from WordPress.org plugin repository. For Premium, download the latest version from Relevanssi.com and...
Free 3.0
The free version of Relevanssi got a long-delayed update, and it turned out to be a major update, probably the biggest ever in the history of Relevanssi. Just look at the changelog... Most of these ar...
Premium 2.14 / Free 4.12
This new version improves Relevanssi excerpt generation, making it faster especially with larger posts. Lots of small bug fixes are also included, making Relevanssi more robust. 2.14.5 / 4.12.5 ...
Custom weighing with relevanssi_match and relevanssi_results
If you want to fine-tune the post weights, version 1.4.5 introduces a new hook for that. The relevanssi_match hook lets you modify the matches found for queries. It passes a match object, which has th...
Premium 2.10 / Free 4.8
After the Summer break, Relevanssi is back with new versions, both to Premium and free. These are mostly small improvements, but when testing the new version, I discovered a bug in the comment indexin...
What if $post->relevance_score is blank or does not exist?
var_dump($post) does not show that field
any ideas?
Yes: are you sure Relevanssi is active? Because if Relevanssi processes posts, that field will be there.
We’re testing this plugin for use on our site and seems to be working great. HOWEVER. we’ve tested the results and it seems that if the search term is matched in the content 1 or 1000 times it still ranks it with the same weight?
if this is the case how can we change this so that it would rank a page higher if it has 5 hits for that term over 1?
We’re only really searching on page title and content, we’re not using tags or categories, so we really need to use the number of times the search term is in the content to help pull more relevant results up the results page.
thanks in advance.
`Scratch that. Seems to be working as i want it to. great stuff.