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.
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.
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?
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?
Yes, that’s probably it – only Relevanssi Premium supports mutisite.