WordPress.org

Support

Support » Plugins and Hacks » Results count fails when Search Reloaded plugin is enabled

Results count fails when Search Reloaded plugin is enabled

  • In the past, I used this code to count the number of results for a search or for archives:
    preg_match('#FROM (.*) GROUP BY#', $request, $matches);
    $fromwhere = $matches[1];
    $numposts = $wpdb->get_var("SELECT COUNT(DISTINCT ID) FROM $fromwhere");
    if (0 < $numposts) $numposts = number_format($numposts);

    In the past with an older version of the Semiologic Search Reloaded plugin it worked absolutely fine.
    I have recently upgraded to WordPress 2.0.x & the latest version of the Search Reloaded plugin – & now my code thinks that it finds 0 results, no matter how many there are.
    If I disable Search Reloaded it works fine once more. It also works fine for other types of archive pages, just not for search.
    Does anyone have any suggestions for what I need to change in my code to make it work again?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Based on my tests, your code works fine with Search Reloaded v.2.2.

    I can verify this (bad) behavior on 2.2 It also causes the “previous posts” “next posts” to not be shown because the count is gone. Only shows the results for one single page based on the number of posts per page you have set. Disabling it puts everything right again.

    By the way I am using this code instead to get the post count which while nasty in technique at least uses the internal WP search to match the exact search process.

    WordPress’s horrible search/results is perhaps it’s worst dirty little secret and in serious need of a major overhaul 🙁

    “It also causes the “previous posts” “next posts” to not be shown because the count is gone. Only shows the results for one single page based on the number of posts per page you have set”

    yes, I can verify that bug on ver 2.6 too, using WP 2.0.5
    I explain the bug in detail here
    http://wordpress.org/support/topic/94442?replies=3

    So I guess we’ll have to wait for the author to upgrade his plugin ?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Results count fails when Search Reloaded plugin is enabled’ is closed to new replies.
Skip to toolbar