• Hello

    i want to ask about weights calculation process and how i can see the affect of the weights on the calculation process

    as i have this problem
    i have talked to you before about the tags weights and you give me this code

    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;
    }

    but its not working very well for all the tags or all the search process i mean if you try to to enter my website and search for (( رام 8 جيجا ))
    the finical calculation weight is strange because i have insert the same sentence (( رام 8 جيجا )) to a specific product to post it how ever its not posted ! and its still not on the first

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Mikko Saari

    (@msaari)

    You can see how the weights work if you search with the Relevanssi admin search (Dashboard > Admin search). It will show you the exact weights Relevanssi calculates.

    5 is a really small multiplier, so that’s one thing. Also, this boost is applied to all individual words, so when you search for “8 giga ram”, this boost is applied to all tags that have “giga” or “ram” in it. By default Relevanssi skips short words, so the “8” is discarded right away. So, all products with tags like “16 giga ram” or “32 giga ram” will also get the same bonus. Since those are fairly common words on your site, this is going to be a hard thing to get right.

    Using phrase matching, ie. putting the search term in quotes, does help a lot.

    Thread Starter moh962008

    (@moh962008)

    is there a solution to boast the full word ?
    i mean if some one write ” 8 giga ram ” then any tag with “giga ram ” will boosted more than any post that have only ” ram ”

    my second question how i can let the relevanssi not skipping the short words ?

    Plugin Author Mikko Saari

    (@msaari)

    Here are instructions for boosting exact matches. There’s no example for boosting a partial taxonomy match, but if you give these instructions to a developer, the rest should be easy for them.

    The minimum word length is adjusted in the indexing settings. If you want to adjust it to 1, you also need this filter hook.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘how weights calculated’ is closed to new replies.