• Resolved quickbrown

    (@quickbrown)


    Hi, I have several blogs with relevanssi installed. Most of them work great, except one blog. The blog using wp 3.01 and relevanssi 2.14. What I mean with doesn’t work is, with relevanssi activated, search result always return zero. When I deactivated relevanssi, the search return one or two results. I have tried several ways to resolve this problem:

    – Deactivated all plugins except relevanssi -> failed
    – Changing wp theme -> failed
    – Upgrading wp to 3.01 (it was 2.92) -> failed
    – Move the blog to localhost -> failed

    Do you have any idea what should I do next? Thanks
    Btw, I love this plugin 🙂

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

    (@msaari)

    Well, that’s strange. Have you tried removing Relevanssi completely and reinstalling it?

    Install the latest version of Relevanssi (2.1.5), then add following line to the script at line 767:

    var_dump($query);

    After the line with $query = ... and before line $matches = .... Let me know what that says.

    Also, you could try uncommenting the debugging lines in the beginning:

    //error_reporting(E_ALL);
    //ini_set("display_errors", 1);

    Like this:

    error_reporting(E_ALL);
    ini_set("display_errors", 1);

    and report any error messages that shows.

    Thread Starter quickbrown

    (@quickbrown)

    Yes, I’ve tried uninstalling and reinstalling relevanssi several times, also trying various version of relevanssi since 2.03 until 2.15.
    I did exactly as you suggested (to my localhost copy), and here is the error message showed up:

    Deprecated: Function split() is deprecated in C:\xampplite\htdocs\wordpress2\wp-content\plugins\relevanssi\relevanssi.php on line 599
    string(88) "SELECT doc, term, tf, title FROM wp_relevanssi WHERE term = 'purple' AND doc IN (667)" string(90) "SELECT doc, term, tf, title FROM wp_relevanssi WHERE term = 'bedrooms' AND doc IN (667)"
    Notice: Undefined variable: term_hits in C:\xampplite\htdocs\wordpress2\wp-content\plugins\relevanssi\relevanssi.php on line 870
    Plugin Author Mikko Saari

    (@msaari)

    Ok, looks like that might be the problem – you’re running a new version of PHP (5.3.0) that has deprecated the split() function. Your other setups have older PHP where using split() is fine and dandy.

    Here’s what you can do: find the bit of the code that has the split() function and just swap the split to explode. If I’m right, that should fix it.

    Thread Starter quickbrown

    (@quickbrown)

    I’ve made change to all split to explode. Soon I checked it by do a search on the blog. Still no results, and here is the error message: (‘purple bedroom’ is the keyword)

    string(88) "SELECT doc, term, tf, title FROM wp_relevanssi WHERE term = 'purple' AND doc IN (667)" string(89) "SELECT doc, term, tf, title FROM wp_relevanssi WHERE term = 'bedroom' AND doc IN (667)"
    Notice: Undefined variable: term_hits in C:\xampplite\htdocs\wordpress2\wp-content\plugins\relevanssi\relevanssi.php on line 870
    Plugin Author Mikko Saari

    (@msaari)

    Well, let’s get rid of that notice and see if that helps. On line 726, after $scores = array(); add $term_hits = array();

    In general notices shouldn’t prevent a PHP script from running, but perhaps your system is set up to hang on the smallest of errors.

    Thread Starter quickbrown

    (@quickbrown)

    Msaari, I think the problem absolutely is not in your plugin, it could be on database or somewhere else.
    Thank you so much for your support 🙂

    thinkin 'bout suicide

    Thread Starter quickbrown

    (@quickbrown)

    Hi Msaari, finally the problem solved by latest relevanssi update. Thanks for your great plugin!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Relevanssi does't work’ is closed to new replies.