Posted on

How to display relevancy score

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.

4 comments How to display relevancy score

  1. 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.

Leave a Reply

Are you a Relevanssi Premium customer looking for support? Please use the Premium support form.

Your email address will not be published. Required fields are marked *