• Dear Mikko!

    Thank you very much for creating this awesome plugin, it makes the WP-search much better!

    However, I noticed, that the result-sorting often doesn’t make much sense. Often, much more relevant pages are behind MUCH less relevant pages.

    For that reason, I have a suggestion.

    Google for example (I know, much more complex algo) have a pretty strong weight on H-Tags & Meta-Titles and URLs.

    So the strongest signals in terms of “headlines” for Google are:

    VERY STRONG: H1, URL, Meta-Title
    STRONG: H2
    WEAKER: H3, H4
    WEAK: H5, H6

    The second step would be: How often does the specific keyword appear in the content (p- tags) ?

    To sum it up: If Relevanssi would have a strong weight on H-Tags/Meta-Title/URL and in a second step term frequency, it would make the results much better!

    H-Tags/Meta-Title/URL should be weighted more than term frequency.

    With this, it would be a very very basic version of the Google algo, but actually would help a lot.

    What do you think of that?

    • This topic was modified 3 years, 8 months ago by danielcob.
    • This topic was modified 3 years, 8 months ago by danielcob.
Viewing 1 replies (of 1 total)
  • Plugin Author Mikko Saari

    (@msaari)

    For starters, Relevanssi has been in development over a decade and is based on industry standard relevance algorithms. Rest assured I’ve given this topic some thought during the years =D

    In general the relevance sorting does work and make sense; most users are very happy with the results. However, depending on how your site is built, it may be the default settings don’t work particularly well on your case. Fortunately Relevanssi offers plenty of settings you can use to adjust the weighting process, and if that’s not enough, you can use filter hooks to take control and adjust just about everything in the weighting. You can have absolute control, and make changes to the process so that you get results that work on your site.

    Your suggestion on weighting the headings heavier is not a bad one; that’s something that’s fairly hard for Relevanssi the way it’s built, as Relevanssi removes all tags while reading the post content. However, it’s something that I’m working on in some future version.

    In any case it’s not a golden rule that always works; consider for example the two biggest sites I have, where one doesn’t use headings at all and on the other one I would actually rather reduce the weight of the headings than increase it, as the headings are not significant.

    If you think headings are very important for your site, Relevanssi certainly doesn’t stop you from increasing the weight of the keywords that appear in the headings. There are filter hooks that will allow you to work on that. For example there’s relevanssi_post_content, which lets you filter the post content before Relevanssi indexing sees it.

    Here’s, for example, a function that will boost H2 headings 4x and H3 headings 2x:

    add_filter( 'relevanssi_post_content', 'rlv_heading_boost' );
    function rlv_heading_boost( $content ) {
        if ( preg_match_all( '/<h2.*?>(.*?)<\/h2>/', $content, $h2_headings ) ) {
            foreach ( $h2_headings[1] as $heading ) {
                $content .= " $heading $heading $heading $heading";
            }
        }
        if ( preg_match_all( '/<h3.*?>(.*?)<\/h3>/', $content, $h3_headings ) ) {
            foreach ( $h3_headings[1] as $heading ) {
                $content .= " $heading $heading";
            }
        }
        return $content;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Suggestion to make Relevanssi-results more relevant’ is closed to new replies.