WordPress.org

Ready to get started?Download WordPress

Forums

Relevanssi - A Better Search
[resolved] X hits and no results displayed from Job Manager plugin (6 posts)

  1. JackTheKnife
    Member
    Posted 1 year ago #

    I have a hard time to display search results from Job Manager plugin (set jobman_job only to be indexing) and I have got:

    Documents in the index: 20
    Terms in the index: 58
    Highest post ID indexed: 1163

    I have comment out query_posts() and still what I'm getting as search results are only 'There are 2 results:' but no results at all.

    Also how can mark custom fields to be indexed? So far is indexing only titles nothing else.

    Thanks

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

  2. JackTheKnife
    Member
    Posted 1 year ago #

    It looks like $wp_query->get_posts() doesn't return anything.

    Here is search code:

    <h1>
                        <?php _e('There are'); ?>
                        <?php /* Search Count */
                            global $wp_query;
                            $key = esc_html($s, 1);
                            $count = $wp_query->post_count;
                            echo '<strong>' . $count . '</strong> ';
                            _e('results:'); 
    
    						// The Loop
    						while ( $wp_query->have_posts() ) :
    							$wp_query->the_post();
    							echo '<li>' . get_the_title() . '</li>';
    						endwhile;
    
    						// Restore original Query & Post Data
    						//wp_reset_query();
    						//wp_reset_postdata();
                        ?>
                        </h1>
    
    					<?php //query_posts($query_string);
    					$wp_query->query_vars['posts_per_page'] = $ds_eth_search_ppp;
    					$wp_query->get_posts();
    					if (have_posts()) : while (have_posts()) : the_post(); ?>
    						<div class="post_holder searchresults">
    							<h2 class="post_header"><a href="<?php the_permalink() ?>" title="See the rest of <?php the_title_attribute(); ?> article."><?php the_title(); if ($post->post_type == 'page'){ ?> - <strong><?php _e('Page'); ?></strong><?php } ?></a></h2>
    							<p class="post_info"><a href="<?php the_permalink() ?>"><?php the_time('j M Y') ?></a><?php if (!($post->post_type == 'page')){ ?> | <a href="<?php the_permalink() ?>"><?php } ?></p>
    							<div class="hr"><div class="inner_hr"></div></div>
    							<div class="clearfix"></div>
    						</div>
    					<?php endwhile; ?>
    					<?php else : ?>
    						<h2 class="center">Not Found</h2>
    						<p class="center">Sorry, but you are looking for something that isn't here.</p>
    					<?php endif;
    					if (function_exists("pagination")) {
    					pagination();
    					} ?>
    				</div>
    				<?php if($ds_eth_search_sidebar_right != 0){ ?>
    				<ul class="gs_<?php echo($ds_eth_search_sidebar_right); ?> sidebar omega">
    					<?php if(function_exists(dynamic_sidebar(8))):
    					dynamic_sidebar(8);
    					endif; ?>
    				</ul>
    				<?php } ?>
    			</div>
  3. JackTheKnife
    Member
    Posted 1 year ago #

    OK, got it half way resolved

    //$wp_query->get_posts();
    if ($wp_query->have_posts()) : while ($wp_query->have_posts()) : the_post(); ?>

    but still searching for a solution how to indexing all fields from Job Manager plugin.

  4. JackTheKnife
    Member
    Posted 1 year ago #

    Custom fields to index: all

    Looks like I'm almost at home ;)

  5. Mikko Saari
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, get_posts() is just as poisonous to Relevanssi as query_posts().

    So, missing anything else?

  6. JackTheKnife
    Member
    Posted 1 year ago #

    I think I'm OK - just need to find out exact names for Job Manager custom fields so I can specify what must to be indexing not all of them.

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic