Title: Text search
Last modified: August 22, 2016

---

# Text search

 *  Resolved [andy_woz](https://wordpress.org/support/users/andy_woz/)
 * (@andy_woz)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/text-search-1/)
 * Is the full text search in the Light Version supposed to work because it doesn’t
   for me? Please let me know.
 * [https://wordpress.org/plugins/filter-custom-fields-taxonomies-light/](https://wordpress.org/plugins/filter-custom-fields-taxonomies-light/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [websupporter](https://wordpress.org/support/users/websupporter/)
 * (@websupporter)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/text-search-1/#post-5277901)
 * 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.
 *  Thread Starter [andy_woz](https://wordpress.org/support/users/andy_woz/)
 * (@andy_woz)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/text-search-1/#post-5277904)
 * Nope not duplicate results, no results.
 *  Thread Starter [andy_woz](https://wordpress.org/support/users/andy_woz/)
 * (@andy_woz)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/text-search-1/#post-5277905)
 * I’m just not getting any results, even if I search on terms that are in select
   options (they are checked off for keywords too).
 * Does this help:
 * Full text url string:
    `/profi-search/#sf-{"1":"North%20Yarmouth","search-id":"
   1"}`
 * Select menu text url string:
    `/profi-search/#sf-{"2":"North%20Yarmouth","search-
   id":"1"}`
 * To get any results I need to clear the full text search first. the meta field
   that the query belongs to is set for both select menu search and keyword.
 * Any ideas?
 *  Plugin Author [websupporter](https://wordpress.org/support/users/websupporter/)
 * (@websupporter)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/text-search-1/#post-5277907)
 * Hi andy,
    it would be great, if you could send me the link. Even better the admin
   credentials.
 * please contact me via [here](http://www.websupporter.net).
 * thanks a lot.
 *  Thread Starter [andy_woz](https://wordpress.org/support/users/andy_woz/)
 * (@andy_woz)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/text-search-1/#post-5277950)
 * Sent email + deets, thanks!
 * A

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Text search’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/filter-custom-fields-taxonomies-light_ffffff.
   svg)
 * [Filter Custom Fields & Taxonomies Light](https://wordpress.org/plugins/filter-custom-fields-taxonomies-light/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/filter-custom-fields-taxonomies-light/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/filter-custom-fields-taxonomies-light/)
 * [Active Topics](https://wordpress.org/support/plugin/filter-custom-fields-taxonomies-light/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/filter-custom-fields-taxonomies-light/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/filter-custom-fields-taxonomies-light/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [andy_woz](https://wordpress.org/support/users/andy_woz/)
 * Last activity: [11 years, 8 months ago](https://wordpress.org/support/topic/text-search-1/#post-5277950)
 * Status: resolved