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.
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.
Not logged in. Log in to see your license details.
…variable, e_search_props. If that appears in the search results URL (like this: https://www.example.com/?s=term&e_search_props=3881765-2885), try removing the e_search_props variable (like this: https://www.example.com/?s=term). If that helps, the problem with your search is right there. One solution is to check what the parameter includes and then overriding those query parameters in a filter……$replace, $content ); } return $content; } ); Conditional and Inline CSS Load Experiment Elementor has this new experimental feature. For some reason, using it with Relevanssi may cause the inline CSS to disappear from the search results page, leading to broken layouts. Disabling the experimental feature solves this problem….Elementor is a popular page builder. It works rather well with Relevanssi, most of the time. Check for e_search_props If the search results come back empty or are restricted to a specific post type, it’s possible Elementor is restricting them. Elementor can hide the query parameters to a single query…
4 Comments. Leave new
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.
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.