Support » Plugin: Relevanssi - A Better Search » How to boost few post against different keywords

  • Hi,

    I have a query:

    How can I boost few posts on top against certain keywords.

    For example:
    1) If I search keyword ‘dell’ then I want some posts to appear on top 3. Currently they appear on the end of the 1st page. Each page display 10 posts.

    Can you please guide how to implement this?

    Thanks

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

    (@msaari)

    The easy way: buy Relevanssi Premium and list “dell” as pinned word for that post.

    The free way: create a relevanssi_hits_filter hook that compares the search query against a custom field in your posts and when there’s a match, lifts the post on top (that’s how Premium does the pinning feature).

    Is there any video demo or screenshot to check this pinned word functionality?

    Also by making a one word “dell” pinned, how i can make 4 posts on top if user searches that keyword?

    Thanks

    Plugin Author Mikko Saari

    (@msaari)

    Here’s a screenshot: https://www.dropbox.com/s/lirzvkou8dr6q78/relevanssi-metabox.jpg?dl=0

    It’s just a text box on the post edit screen where you can enter search terms.

    If you want to pin four posts for the keyword “dell”, you need to enter that keyword to all four posts. Those four posts will then be on top of the results when someone searches for “dell”, in order of relevance, then you’ll get rest of the posts in order of relevance.

    Thanks for this. And can you give some code example that how to implement in free version also?

    Plugin Author Mikko Saari

    (@msaari)

    There are code examples for relevanssi_hits_filter in the Relevanssi user manual: https://www.relevanssi.com/user-manual/relevanssi_hits_filter/

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to boost few post against different keywords’ is closed to new replies.