relevanssi: blog posts not found
-
Hello,
I’m helping troubleshoot a site which uses the relevanssi plugin to do search. Right now we’re not getting results from blog posts, only from pages.
I’ve followed these instructions: https://www.relevanssi.com/knowledge-base/how-to-debug-indexing-problems/ to confirm that blog posts are being indexed correctly. I’ve also examined the database to confirm that the terms actually made it into the database.
Hacking around inside relevanssi, it appears that the query being built looks something like this:
SELECT relevanssi.*, relevanssi.title * 5 + relevanssi.content + relevanssi.comment * 0 + relevanssi.tag * 1 + relevanssi.link * 0 + relevanssi.author + relevanssi.category * 2 + relevanssi.excerpt + relevanssi.taxonomy + relevanssi.customfield + relevanssi.mysqlcolumn AS tf FROM wp_relevanssi AS relevanssi WHERE relevanssi.term = 'energizing' AND ((relevanssi.doc IN (SELECT DISTINCT(posts.ID) FROM wp_posts AS posts WHERE posts.post_type IN ('page'))) OR (doc = -1)) ORDER BY tf DESC LIMIT 500
and the problem is the
posts.post_type IN ('page')
— obviously it’s excluding blog posts, which have post_type ‘post’. But I wasn’t able to reason out exactly how it gets set to do that.This is a paste of our theme’s search template: https://pastebin.com/A22cc0QW
I’d be grateful for any advice.
- The topic ‘relevanssi: blog posts not found’ is closed to new replies.