WordPress.org

Ready to get started?Download WordPress

Forums

Results count fails when Search Reloaded plugin is enabled (4 posts)

  1. mat8iou
    Member
    Posted 8 years ago #

    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?

  2. Denis de Bernardy
    Member
    Posted 8 years ago #

    Based on my tests, your code works fine with Search Reloaded v.2.2.

  3. _ck_
    Member
    Posted 7 years ago #

    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 :(

  4. laslo
    Member
    Posted 7 years ago #

    "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 ?

Topic Closed

This topic has been closed to new replies.

About this Topic