If the Relevanssi debugger doesn’t tell you why the posts are excluded, you can try this:
add_filter( 'relevanssi_indexing_restriction', function( $restriction ) {
error_log( $restriction['mysql'] );
return $restriction;
} );
Add this to your theme functions.php and reindex, and it will print to your error_log the exclusion code Relevanssi uses. That should give you an explanation of why the posts are being excluded.
Hi Mikko,
Thanks for the answer.
I added the following code:
function test_relevanssi_log($restriction) {
error_log('==='. PHP_EOL . $restriction['mysql'] . PHP_EOL, 3, $_SERVER['DOCUMENT_ROOT'] .'/relevanssi_log.txt');
return $restriction;
}
add_filter('relevanssi_indexing_restriction', 'test_relevanssi_log');
And this is what I got:
===
===
===
===
===
===
===
===
===
===
AND post.post_type IN ('post', 'page', 'attraction-guideline', 'user-manual', 'products', 'general', 'teams', 'wfm', 'development', 'guest-guidelines', 'partner-guidelines', 'senior-guidelines', 'guest-manual', 'partner-manual')
===
===
AND post.post_type IN ('post', 'page', 'attraction-guideline', 'user-manual', 'products', 'general', 'teams', 'wfm', 'development', 'guest-guidelines', 'partner-guidelines', 'senior-guidelines', 'guest-manual', 'partner-manual')
===
===
===
===
===
===
===
===
===
===
Plugin indexing settings page in admin panel: https://prnt.sc/1kma146
A Relevanssi Premium client had a similar issue recently, and in their case this same behaviour was caused by a missing wp_relevanssi database table. Could this be the case here as well?
Hi Mikko,
Yes, the problem was with the database user who didn’t have permission to create tables.
Thanks for the solution.