• Resolved fooey

    (@fooey)


    I have re-indexed and cannot figure out why an exact match is not showing until the third page of the results. I have exact match boosting and there are pages that have no matching content showing before the exact match. I have tried adding the PHP snippet, and checked all settings as suggested in other posts but still not working correctly. I checked how relevanssi sees the post and I see all of the words and phrases in the title. Any suggestions here? It’s almost as if it’s not working at all. The link is the search I am performing with the exact title so you can see what it’s doing. Thanks!

    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)

    Your search results are not ordered by relevance. If I add &orderby=relevance to the end of the search results page URL to force the order to be by relevance, the exact match results are first.

    Try adding this function to your theme functions.php or in a code snippet to force the result order:

    add_filter( 'relevanssi_modify_wp_query', function( $query ) {
      $query->set( 'orderby', array( 'relevance' => 'desc' ) );
      return $query;
    } );
    Thread Starter fooey

    (@fooey)

    That seemed to do the trick! One question, in my settings it is supposed to sort by relevance, Is there something overwriting this? Kinda the point of the plugin ay? : )
    thanks

    Plugin Author Mikko Saari

    (@msaari)

    orderby is a common WordPress query parameter, and other plugins may mess with it. Common culprits are all sorts of custom post order plugins.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Exact match not working’ is closed to new replies.