• Resolved bbuerger

    (@bbuerger)


    Hi,

    is it possible to show only results matching the title to some users but results matching either title or content to others?

    I cannot use weight since I need the results ordered by date instead of relevance.

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

    (@msaari)

    Yes, and adjusting weights is exactly the way to go.

    To ignore post content, you can do this:

    add_filter( 'pre_option_relevanssi_content_boost', function( $content_boost ) {
        return 0;
    } );

    Now weight for all content matches is zero. All you need to add to the function is some logic to set the weight to 0 to those users where you want only titles to match and return the $content_boost untouched for the users who should get content matches.

    Thread Starter bbuerger

    (@bbuerger)

    Wow, this was fast. Thank you so much for your reply. I will try this out right away.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Different results for different users’ is closed to new replies.