Support » Plugin: Relevanssi - A Better Search » No Search Results WP 3.8.1 RV 3.3.4
No Search Results WP 3.8.1 RV 3.3.4
-
Hi, I was updating a number of sites today, and I’m in the habit of rebuilding the search index for Relevanssi when I make any major updates. After today’s update (3.8 to 3.8.1 and a number of other plugins, including Relevanssi 3.3.4) I’m getting 0 search results on any terms:
http://www.stewardshipontario.ca/?s=ontario
Are there any troubleshooting steps I can take to see what’s up? I have disabled/reenabled the plugin, rebuilt the index, cleared my site cache, tried with and without disabling OR fallback, etc.
Any other ideas?
-
Can you show me your search results template?
Hi Mikko,
Absolutely. Here is the search results template:
<?php get_header(); ?> <div class="breadcrumbs bc-general"><div class="inner"> <?php if(function_exists('bcn_display')) { bcn_display(); } ?> </div></div> <!-- Wrapper --> <div class="wrapper" id="interior"> <aside id="sidebar"> <?php dynamic_sidebar('general-sidebar') ?> </aside> <!-- Section --> <section> <h1><?php echo sprintf( __( '%s Search Results for ', 'html5blank' ), $wp_query->found_posts ); echo get_search_query(); ?></h1> <?php if (have_posts()): ?> <!-- Pagination --> <div id="pagination"> <?php html5wp_pagination(); ?> </div> <!-- /Pagination --> <?php while (have_posts()) : the_post(); ?> <!-- Article --> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <!-- Post Thumbnail --> <?php if ( has_post_thumbnail()) : // Check if Thumbnail exists ?> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"> <?php the_post_thumbnail(array(80,80)); // Declare pixel size you need inside the array ?> </a> <?php endif; ?> <!-- /Post Thumbnail --> <?php if ( 'newsletter-archive' == get_post_type() ) { ?> <!-- Post Title --> <h3 style="margin-bottom: 0px;"><a href="<?php $newsletterurl = types_render_field("newsletter-link", array("raw"=>"true")); echo $newsletterurl; ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3> <!-- /Post Title --> <?php } else { ?> <!-- Post Title --> <h3 style="margin-bottom: 0px;"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3> <!-- /Post Title --> <?php } ?> <!-- Post Details --> <span class="date">Published on <?php the_time('F j, Y'); ?> <?php //the_time('g:i a'); ?></span> <!-- /Post Details --> <div class="excerpt"><? $myexcerpt = get_the_excerpt(); if ( strlen($myexcerpt) > 350 ) { echo substr($myexcerpt,0,348)."…"; } else { the_excerpt(); } ?><br /> <?php if ( 'newsletter-archive' == get_post_type() ) { ?> <a href="<?php $newsletterurl = types_render_field("newsletter-link", array("raw"=>"true")); echo $newsletterurl; ?>" title="<?php the_title(); ?>">Read More</a> <?php } else { ?> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">Read More</a> <?php } ?> </div> <br class="clear" /> <?php //edit_post_link(); ?> </article> <!-- /Article --> <?php endwhile; ?> <?php else: ?> <!-- Article --> <article> <h3><?php _e( 'Sorry, nothing to display.', 'html5blank' ); ?></h3> </article> <!-- /Article --> <?php endif; ?> <!-- Pagination --> <div id="pagination"> <?php html5wp_pagination(); ?> </div> <!-- /Pagination --> </section> <!-- /Section --> <style type="text/css"> article .wp-post-image { float: right; border-radius: 3px; border-bottom: 5px solid; width: 150px; margin-left: 20px; margin-bottom: 20px; } </style> <div style="clear:both;"></div> </div> <!-- /Wrapper --> <?php get_footer(); ?>
Nothing offensive there… though if that sidebar may be a problem. You might want to try disabling the sidebar for a moment (comment out the dynamic_sidebar() call) and see if that helps.
No, that doesn’t make a difference, unfortunately 🙁
Any other thoughts?
What do you get if you add this to your functions.php:
add_filter('relevanssi_query_filter', 'check_rlv_query'); function check_rlv_query($query) { var_dump($query); return $query; }
and then run a search?
Hi Mikko,
This is what it outputted on the top of the site:
string(726) "SELECT relevanssi.*, relevanssi.title * 5 + relevanssi.content + relevanssi.comment * 0.75 + relevanssi.tag * 0.75 + relevanssi.link * 0 + relevanssi.author + relevanssi.category * 0.75 + relevanssi.excerpt + relevanssi.taxonomy + relevanssi.customfield + relevanssi.mysqlcolumn AS tf FROM b0eg4m7b2_relevanssi AS relevanssi WHERE relevanssi.term = 'ontario' AND relevanssi.doc NOT IN () AND ((relevanssi.doc IN (SELECT DISTINCT(posts.ID) FROM b0eg4m7b2_posts AS posts WHERE posts.post_type IN ('post', 'page', 'attachment', 'case-study', 'download', 'events', 'slides', 'media-release', 'image-and-video', 'engagement', 'newsletter-archive', 'resources', 'glossary'))) OR (doc = -1)) ORDER BY tf DESC LIMIT 100" string(744) "SELECT relevanssi.*, relevanssi.title * 5 + relevanssi.content + relevanssi.comment * 0.75 + relevanssi.tag * 0.75 + relevanssi.link * 0 + relevanssi.author + relevanssi.category * 0.75 + relevanssi.excerpt + relevanssi.taxonomy + relevanssi.customfield + relevanssi.mysqlcolumn AS tf FROM b0eg4m7b2_relevanssi AS relevanssi WHERE (term LIKE '%ontario' OR term LIKE 'ontario%') AND relevanssi.doc NOT IN () AND ((relevanssi.doc IN (SELECT DISTINCT(posts.ID) FROM b0eg4m7b2_posts AS posts WHERE posts.post_type IN ('post', 'page', 'attachment', 'case-study', 'download', 'events', 'slides', 'media-release', 'image-and-video', 'engagement', 'newsletter-archive', 'resources', 'glossary'))) OR (doc = -1)) ORDER BY tf DESC LIMIT 100" string(726) "SELECT relevanssi.*, relevanssi.title * 5 + relevanssi.content + relevanssi.comment * 0.75 + relevanssi.tag * 0.75 + relevanssi.link * 0 + relevanssi.author + relevanssi.category * 0.75 + relevanssi.excerpt + relevanssi.taxonomy + relevanssi.customfield + relevanssi.mysqlcolumn AS tf FROM b0eg4m7b2_relevanssi AS relevanssi WHERE relevanssi.term = 'ontario' AND relevanssi.doc NOT IN () AND ((relevanssi.doc IN (SELECT DISTINCT(posts.ID) FROM b0eg4m7b2_posts AS posts WHERE posts.post_type IN ('post', 'page', 'attachment', 'case-study', 'download', 'events', 'slides', 'media-release', 'image-and-video', 'engagement', 'newsletter-archive', 'resources', 'glossary'))) OR (doc = -1)) ORDER BY tf DESC LIMIT 100" string(744) "SELECT relevanssi.*, relevanssi.title * 5 + relevanssi.content + relevanssi.comment * 0.75 + relevanssi.tag * 0.75 + relevanssi.link * 0 + relevanssi.author + relevanssi.category * 0.75 + relevanssi.excerpt + relevanssi.taxonomy + relevanssi.customfield + relevanssi.mysqlcolumn AS tf FROM b0eg4m7b2_relevanssi AS relevanssi WHERE (term LIKE '%ontario' OR term LIKE 'ontario%') AND relevanssi.doc NOT IN () AND ((relevanssi.doc IN (SELECT DISTINCT(posts.ID) FROM b0eg4m7b2_posts AS posts WHERE posts.post_type IN ('post', 'page', 'attachment', 'case-study', 'download', 'events', 'slides', 'media-release', 'image-and-video', 'engagement', 'newsletter-archive', 'resources', 'glossary'))) OR (doc = -1)) ORDER BY tf DESC LIMIT 100"
relevanssi.doc NOT IN ()
is the problem.Download the development version from this page (direct link to the file) and try that – if I’m right, that should fix the problem.
Yes! Thank you! That definitely did it:
http://www.stewardshipontario.ca/?s=ontario
Is this something unique to this site, or is this a general fix coming to Relevanssi 3.3.x?
It’s a common bug – well, it’s something specific on your site that is triggering it, I’m not sure what – and it was supposed to be fixed in the latest version, but the fix is wrong. The next version will fix it for good.
- The topic ‘No Search Results WP 3.8.1 RV 3.3.4’ is closed to new replies.