• Resolved SRES

    (@sres)


    Hi,
    I have noticed that search result have some problems in relevace, after some research of your plugin I inplement some code that help better relevace result.
    1. in table wp_relevanssi insert two columns, one column which care about is term in title post and give it 100 (I give it 100 but may be some other number but after in calculation mutilpy with large number to get large score) point, second column which care about is term is 100% title or percent of length (for example title is “red rose” and word “red” is about 40(%) of title and rose is about 60(%) of title), so if you search red you got top result “red” if you have post with title “red” and second is “red rose” no matter if in post “red rose” in content is more words “red”, calculation give that result because title red got 100 (found in title) + in title length is 100 + if in content have mention same word.

    • This topic was modified 9 years, 9 months ago by SRES.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mikko Saari

    (@msaari)

    You don’t need to modify the database or the plugin code; you can implement this with the filters Relevanssi currently provides.

    First of all, there’s already the “title” column, which marks whether the word appears in a title or not. So no need to replicate that. Then there’s the “Title weight” setting in Relevanssi settings you can use to add extra weight for title matches.

    Here’s how you can boost exact title matches. If you want more than that, you can write a relevanssi_hits_filter function that will move the exact title matches on top in the results.

    But there you have it – the same effect, in nine lines of code instead of modifying the database and all the complications that requires.

    Thread Starter SRES

    (@sres)

    Thank You for tip, this is usefull I will try with these

    • This reply was modified 9 years, 9 months ago by SRES.
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Suggestion for relevanssi’ is closed to new replies.