Hi Andy,
no, its supposed to work. What exactly is the problem and the settings? I’ve checked a bit into the fulltext search since I was optimizing it for the next premium version.
If you get double results, please replace the function sf_content_filter
in the file profi-search-filter.php with the following code:
function sf_content_filter( $sf_where, &$wp_query ){
global $wpdb;
if( $wp_query->get( 'sf-title' ) || $wp_query->get( 'sf-meta' ) || $wp_query->get( 'sf-content' ) || $wp_query->get( 'sf-excerpt' ) ):
$concat_fields = array();
$st = $wp_query->get( 'sf-title' );
if( isset( $st ) && !empty( $st ) ):
$concat_fields[] = $wpdb->posts . '.post_title';
$search_term = $st;
endif;
$st = $wp_query->get( 'sf-content' );
if( isset( $st ) && !empty( $st ) ):
$concat_fields[] = $wpdb->posts . '.post_content';
$search_term = $st;
endif;
$st = $wp_query->get( 'sf-excerpt' );
if( isset( $st ) && !empty( $st ) ):
$concat_fields[] = $wpdb->posts . '.post_excerpt';
$search_term = $st;
endif;
$metas = $wp_query->get( 'sf-meta' );
$post_meta_keys = array();
if( isset( $metas ) && is_array( $metas ) && count( $metas ) > 0 ){
foreach( $wp_query->get( 'sf-meta' ) as $meta => $search_term ){
preg_match( '^meta\[(.*)\]^', $meta, $match );
$concat_fields[] = md5( $meta ) . '.meta_value';
$post_meta_keys[ md5( $meta ) ] = $match[1];
}
}
$concat_string = '';
foreach( $concat_fields as $f ):
$concat_string .= ',' . $f . ', " "';
endforeach;
$sf_add_where = '';
if( !empty( $concat_string ) ):
$sf_add_where = ' AND (';
$concat_string = "CONCAT( \"\" " . $concat_string . ") LIKE '%" . esc_sql( like_escape( $search_term ) ) . "%' ";
$sf_add_where .= $concat_string;
$sf_add_where .= ' ) ';
if( count( $post_meta_keys ) > 0 ):
foreach( $post_meta_keys as $key => $val ):
$sf_add_where .= " AND " . $key . ".meta_key ='" . $val . "'";
endforeach;
endif;
endif;
$sf_where .= $sf_add_where;
endif;
return $sf_where;
}
This code will be soon also in the premium version and I will update the free version as soon as possible.
I hope, this solves your problem.