Support » Plugin: gee Search Plus, improved WordPress search » Change relevance order

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Luis Godinho

    (@luistinygod)

    Hi Laura,

    You may change the relevance order by hooking in the following filters, which are meant to change the relevance weight of any search term found on title, post content or taxonomy:

    gee_search_title_weight (default = 5)
    gee_search_content_weight (default = 1)
    gee_search_taxonomy_weight (default = 2)

    For example, to change the title relevance weight to value 10, add the following to your theme functions.php file:

    add_filter( 'gee_search_title_weight' , 'my_title_weight' );
    function my_title_weight( $weight ) {
        return 10;
    }

    Hope this helps.

    Thread Starter lauranoir

    (@lauranoir)

    Hi luistinygod,

    This is great, thank you for your help. I am an ultimate beginner, so I just need you to walk me through step-by-step. Are all these 3 filters numbered with the right relevance weight and how/where do I enter them? Do I need to code them all like the title reference code you did?

    What’s the difference between value 10 and 5 in terms of relevance weight? No idea how any of that works.

    Thanks for all your help!!

    Laura xx

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change relevance order’ is closed to new replies.