• I have no idea what the cause is. Relevanssi was working fine, Ajax Load More was working fine, but combining the two caused only partial results to appear.

    Debugging, the $wp_query that came back from Relevanssi had 15 posts. But Ajax Load More only showed one of them.

    The solution was to make the “post__in” array use only IDs, instead of post objects.

    The main cause is still unidentified.

    Here is the code that solved the issue for me:

    function fullest_alm_query_args_relevanssi($args){
    	$args = apply_filters('alm_relevanssi', $args);
    	
    	if ( !empty($args['post__in']) ) {
    		if ( is_object($args['post__in'][0]) ) {
    			foreach( $args['post__in'] as $k => $v ) {
    				$args['post__in'][$k] = $v->ID;
    			}
    		}
    	}
    	
    	return $args;
    }
    add_filter( 'alm_query_args_relevanssi', 'fullest_alm_query_args_relevanssi');
  • The topic ‘Fix a bug with lack of search results’ is closed to new replies.