Support » Plugin: Relevanssi - A Better Search » [Plugin: Relevanssi – A Better Search] Index Completes, 0 items indexed. Have some debug data.

  • I’ve been trying to follow some documentation on the official site so far. I used to get just 1 item indexed, and it was one of my custom sidebars (a custom post type), which seemed random. I don’t want sidebars indexed so I adjusted the custom settings.

    I changed the plugin file to have it print the list of ID’s it’s trying to index and I get a ton of them. If I turn on $wpdb->show_errors I get:
    ‘WordPress database error: []
    SELECT *,parent.post_status as post_status FROM wp_posts parent, wp_posts post WHERE (parent.post_status IN (‘publish’, ‘private’, ‘draft’, ‘pending’, ‘future’)) AND ( (post.post_status=’inherit’ AND post.post_parent=parent.ID) OR (parent.ID=post.ID) ) AND post.post_type!=’nav_menu_item’ AND post.post_type!=’revision’ AND post.post_type!=’attachment’ AND ( post.post_type = ‘post’ OR post.post_type = ‘page’ OR post.post_type = ‘sermon’ OR post.post_type = ‘staff’)

    and if i paste that query into phpmyadmin I get the expected tables selected properly.

    I don’t know why these aren’t getting put into the index. or why just one random post used to be the only thing getting in.

    Thanks!

    http://wordpress.org/extend/plugins/relevanssi/

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

    (@msaari)

    What if you dump out all the INSERT queries – what do you get? See the last trick on the debugging Relevanssi page.

    Thread Starter Jpyper

    (@jpyper)

    The lines the last trick mentions are not in my relevanssi.php file. They are nowhere to be found. I tried adding the var_dump and print_error to lines 2376 and 2377 of relevanssi.php but don’t see anything different happening.

    Plugin Author Mikko Saari

    (@msaari)

    Oh, sorry, that’s in Premium. In non-Premium Relevanssi, the relevant INSERT queries are indeed around line 2370.

    If you can’t get those to print out, then see what happens to the $content as it passes through the different functions. Where it disappears?

    Thread Starter Jpyper

    (@jpyper)

    Like I mentioned in the post before yours here, that’s actually where I added the code on a guess and I don’t see anything different when I build the index. I tried just echoing something in that if statement and nothing echos, even if I make an else and try to echo, I see nothing. Should I be seeing it right after I build index?

    I get nothing when trying to dump the insert queries.

    Plugin Author Mikko Saari

    (@msaari)

    Yeah, it should dump out hundreds and hundreds of INSERT queries. So yeah, something is thoroughly broken in the process. Hard to tell what, unless you can pinpoint exactly where the process fails. That can be done by adding var_dump()-exit() combinations to the code and moving them around until you find the place where things break down.

    Thread Starter Jpyper

    (@jpyper)

    I changed my settings to not exclude any post types, since I was getting just a single item indexed that way.

    I put the dump stuff into the spot where Titles are inserted into the database (around line 2358), and it looks like it’s trying to add the same thing into the database multiple times. I get this:

    WordPress database error: []
    INSERT INTO wp_relevanssi (doc, term, tf, title) VALUES (3871, '', 1, 0)
    
    string(4) "2588" string(75) "INSERT INTO wp_relevanssi (doc, term, tf, title) VALUES (3871, '', 1, 0)"
    WordPress database error: []
    INSERT INTO wp_relevanssi (doc, term, tf, title) VALUES (3871, '', 1, 0)
    
    string(4) "2885" string(75) "INSERT INTO wp_relevanssi (doc, term, tf, title) VALUES (3871, '', 1, 0)"

    and so on repeated many many times with just the number after string(4) changing each time. The post ID that it’s repeatedly inserting (3871) is the single one that is getting indexed. If I change my settings to only index “post, page” and my other 2 custom post types, I don’t see any insert queries.

    Does this help?

    Plugin Author Mikko Saari

    (@msaari)

    Ok, so it’s not getting any terms from the posts… I don’t know, this is somehow a rather complicated problem and it’s hard to say what’s wrong. Somehow the MySQL query isn’t fetching the correct results, even though it works in phpMyAdmin.

    One thing it can be is a conflict with another plugin. You might want to try disabling other plugins to see if that helps.

    Thread Starter Jpyper

    (@jpyper)

    Even with all plugins turned off except for Relevanssi I get the same results.

    Would it matter than this is a site in a multi-site install? I forgot about that since it’s in my development environment which is multi-site. It will be transferred to a single install eventually. But could that be causing the issue?

    Plugin Author Mikko Saari

    (@msaari)

    Yes, that’s probably it – only Relevanssi Premium supports mutisite.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: Relevanssi – A Better Search] Index Completes, 0 items indexed. Have some debug data.’ is closed to new replies.