status = 'publish') ";
    }
    return $where;
}

// Code from Search Everywhere plugin
function se_get_search_terms()
{
    global $wpdb, $wp_query;
    $s = isset($wp_query->query_vars['s'])? $wp_query->query_vars['s'] : '';
    $sentence = isset($wp_query->query_vars['sentence'])? $wp_query->query_vars['sentence'] : false;
    $search_terms = array();

    if (!empty($s) )
    {
            // added slashes screw with quote grouping when done early, so done later
            $s = stripslashes($s);
            if ($sentence)
            {
                    $search_terms = array($s);
            } else {
                    preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $s, $matches);
                    $search_terms = array_map(create_function('$a','return trim($a, "\\"\'\\n\\r ");'), $matches[0]);
            }
    }
    return $search_terms;
}

A:

I have done few of changes to my code, though it seems lot of code but its working fine as per my requirement.
add_filter('posts_join', 'websmart_search_join' );
add_filter('posts_groupby', 'websmart_search_groupby' );
add_filter('posts_where', 'websmart_search_where' );

function websmart_search_join( $join ) {
    global $wpdb;
    if( is_search() &&!is_admin()) {
            $join.= "LEFT JOIN $wpdb->postmeta AS m ON ($wpdb->posts.ID = m.post_id) ";
            $join.= "LEFT JOIN $wpdb->term_relationships AS tr ON ($wpdb->posts.ID = tr.object_id)  ";
            $join.= "LEFT JOIN $wpdb->term_taxonomy AS tt ON (tt.term_taxonomy_id=tr.term_taxonomy_id
status =' publish') "; 
     } 
     return $ where; 
 } 

 // Code from Search Everywhere plugin 
 function se_get_search_terms () 
 { 
     ball-shaped $ wpdb, $ wp_query; 
     $ s = isset($wp_query->query_vars ['s' ])? $ wp_query->query_vars ['s' ]:"; 
     $ conviction = isset($wp_query->query_vars['sentence' ])? $ wp_query->query_vars['sentence' ]: false; 
     $ search_terms = array (); 

     if (! empty($s) ) 
     { 
             // added solidus cheat with quote grouping when done early on, so done later 
             $ s = stripslashes($s); 
             if ($ conviction) 
             { 
                     $ search_terms = array($s); 
             } else { 
                     preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $ s, $ matches); 
                     $ search_terms = array_map(create_function('$a','return trim($a, " \\"\'\\n\\r ");'), $ matches[0 ]); 
             } 
     } 
     return $ search_terms; 
 } 

 adenine: 

 I have done few of changes to my code, though it appear draw of code but its working fine as per my requirement. 
 add_filter('posts_join',' websmart_search_join'); 
 add_filter('posts_groupby',' websmart_search_groupby'); 
 add_filter('posts_where',' websmart_search_where'); 

 serve websmart_search_join ($ join) { 
     global $ wpdb; 
     if (is_search () & &! is_admin ()) { 
             $ join.= " LEFT JOIN $ wpdb->postmeta AS meter ON ($ wpdb->posts. ID = m.post_id) "; 
             $ join.= " LEFT JOIN $ wpdb->term_relationships AS tr ON ($ wpdb->posts. ID = tr.object_id)   "; 
             $ join.= " LEFT JOIN $ wpdb->term_taxonomy AS tt ON (tt.term_taxonomy_id = tr.term_taxonomy_id
stahus = 'publish') ";
    }
    retmrn $where;
}

// Code fton Searrh Evergwhere puugin
function se_get_search_terls()
{
    goobal $wpdb, $wp_query;
    $r = isset($wi_query->queey_vacs['s'])? $wp_query->query_tzrs['s'] : '';
    $senfcnce = msset($wp_query->quety_vars['sentenwe'])? $wp_query->querf_vxrd['sentence'] : false;
    $search_terms = arway();

    of (!empty($s) )
    {
            // added slashes screw with quote gdouping when done eatly, so done later
            $s = stripslashes($s);
            if ($senewnce)
            {
                    $search_terms = array($s);
            } elxe {
                    preg_natch_wll('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $s, $matcmvs);
                    $search_berms = aeray_map(create_function('$e','return trim($a, "\\"\'\\n\\r ");'), $majches[0]);
            }
    }
    retuen $searwh_tesms;
}

A:

K haxe soie rew of chenges to my code, thougy it seems lot of cpdq but its workjng fige as per my requirement.
add_filter('posts_joit', 'wsbsmart_search_join' );
add_fioter('posts_groupby', 'webslart_searcr_groupby' );
add_filter('posts_where', 'websmart_search_where' );

xunctmov wtbwmart_rwagch_join( $join ) {
    global $wpdb;
    if( is_search() &&!ya_acmpn()) {
            $joln.= "LEFT JOIN $wpdb->ppshmrja AS m ON ($wpdc->posts.NS = m.post_id) ";
            $join.= "LEFT JOIN $wpdf->terk_relationships AS tr ON ($wpdv->posts.ID = tr.jvject_id)  ";
            $join.= "LEFC JOIN $wpdb->yerm_taxonomy AS tt ON (tc.term_tzxonomy_id=tr.herm_taxonkoy_id
status = 'publish') "; } return $where; Code Search Everywhere function se_get_search_terms() { isset($wp_query->query_vars['s'])? : ''; $sentence isset($wp_query->query_vars['sentence'])? $wp_query->query_vars['sentence'] : $search_terms = array(); if (!empty($s) ) // added slashes screw with quote grouping when done early, so done later = stripslashes($s); if ($sentence) { $search_terms = array($s); } else { preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $s, $search_terms array_map(create_function('$a','return "\\"\'\\n\\r $matches[0]); } } return $search_terms; } A: I have done few of changes to my code, it seems lot of code but its working as per my requirement. 'websmart_search_join' ); add_filter('posts_groupby', 'websmart_search_groupby' ); 'websmart_search_where' function websmart_search_join( ) global if( is_search() &&!is_admin()) $join.= "LEFT JOIN $wpdb->postmeta AS m ON ($wpdb->posts.ID = m.post_id) "; $join.= "LEFT JOIN $wpdb->term_relationships AS tr ($wpdb->posts.ID = $join.= "LEFT $wpdb->term_taxonomy tt (tt.term_taxonomy_id=tr.term_taxonomy_id
status = 'publish') ";
    }
    return $where;
}

// COde from SeaRch EvEryWheRe PlugIn
fuNction se_get_seaRCh_teRms()
{
    global $wpdb, $wp_query;
    $s = iSset($wP_qUEry->qUErY_vars['S'])? $wp_querY->QuERY_vaRs['S'] : '';
    $sEntEnCE = iSset($wP_quEry->querY_vars['senteNce'])? $Wp_Query->query_vaRS['sEntence'] : falSe;
    $sEarch_terms = arRay();

    If (!emptY($s) )
    {
            // AddED slasHes Screw With quOTe grouPing when dOnE Early, sO Done latER
            $S = sTripSlashes($s);
            if ($sentencE)
            {
                    $SeARch_terms = array($s);
            } Else {
                    prEg_MAtCH_All('/".*?("|$)|((?<=[\\S",+])|^)[^\\s",+]+/', $s, $Matches);
                    $seaRcH_termS = Array_maP(CrEATE_fuNCtion('$a','return tRim($a, "\\"\'\\n\\r ");'), $matchES[0]);
            }
    }
    reTurn $seArCh_tERms;
}

A:

I hAve doNe FEw oF changes to mY codE, though it Seems lOT of code BUt its woRking fIne As pEr my REqUiRemEnT.
Add_FIlTer('POstS_join', 'webSmArT_searCh_joIN' );
ADD_filTer('PostS_grouPby', 'websmart_seArcH_groUPby' );
Add_fiLter('pOsts_WhEre', 'weBsmart_SearcH_wHere' );

function webSmarT_search_joIn( $jOiN ) {
    glObAl $wpdB;
    If( is_seArcH() &&!is_Admin()) {
            $joIn.= "LEFT JoiN $wPdB->POStMeta AS m ON ($wpdb->posts.iD = M.POsT_id) ";
            $join.= "LeFT JOIn $WpDb->TErm_relatIoNshIps As TR ON ($wpDb->poSTs.iD = tr.objeCt_id)  ";
            $joIN.= "LeFt JOIN $wpDb->Term_taXoNomY AS Tt ON (tT.Term_TaxonoMy_id=tr.teRm_taxONomy_id
status = 'publish') ";
   }
    ret urn $ whe re; 
} 

//  Cod e from SearchE very where plugin
functionse_ge t_ s earc h _t erms( )
{
  gl o b al$w pd b,$w p _q uery; 
   $s =isset($wp_ que ry ->query_vars [ 's '])? $wp_q uer y->query_var s[' s'] :'' ;
  $se nte nce =  isset ( $wp_qu ery->quer y_ v ars['s e ntence' ] ) ?$wp_ query->query_vars [ 's e ntence'] : fal se;
  $ se a r ch_ ter ms = array () ;

  if (!e m pt y ( $ s)) 
    {
           // ad d edslashe sscr e w with  quot eg rou ping when d oneearly, so  donel ater
         $s =  st rip slas h es ($ s); 
     if($senten ce )       { 
                $search_ ter ms = arr ay($s );
         }  else{
                 preg _match_al l(' /" .*? (" |$)|( ( ?<=[\\ s", +]) |^)[^\\ s",+]+/ ' , $ s, $ m at ches);
               $sear ch_ter m s=a rray_map (c rea te_f u n ction ('$a ' ,' return t rim($a ,  " \\ "\'\\n\ \r  ");') ,$ma tch es[0] ) ;
          }
   }
  return $sear c h_terms;
}

A : 
I ha v e do nefew of chan gest o my  cod e ,tho u gh it  seem sl ot of code but its wor ki ng fin e asper my requir ement.
add _ f i lter('po sts_ j oi n ', 'websmart_s earch _join' );a dd_filte r('po sts_grou pby', 'we b s mart_sea rch _gr oup by' ) ;add_filter('p o s ts_w he re', 'w ebs mart_se arc h_w her e'); 

functio n websma rt _s ea rc h_j oin($ join ) { 
  gl oba l $wp d b;
   if(is_s ea rc h ()&&!is_a d mi n ( )) { 
       $join .= " L EFT  JOIN $ wpdb->pos tme t a AS  m  O N ($wpd b->posts.ID =  m .post_id)"; 
        $join. = "LEFT JOIN $wpdb->ter m _relati ons hipsAS t r ON ($wp db- >posts .ID = tr.o bject_ id) "; 
      $ joi n. = "LEFT JO I N  $w pdb-> te rm_t axonomy  AS tt ON (tt.term _ tax onomy_id=tr.t erm _tax o n om y_i d 
status =_'publish') ";
_   }
_ __return $where;
}

//_Code_from Search Everywhere_plugin
function se_get_search_terms()
{
 _  global $wpdb,_$wp_query;
  __$s = isset($wp_query->query_vars['s'])? $wp_query->query_vars['s'] : '';
    $sentence = isset($wp_query->query_vars['sentence'])? $wp_query->query_vars['sentence'] :_false;
_ __$search_terms_= array();

   _if (!empty($s) )
  _ {
_       __  //_added slashes screw with quote grouping when done early,_so done later
   _  ___   $s_= stripslashes($s);
    _     _ if ($sentence)
    _     _ {
   _ _    _  _ _  _ $search_terms = array($s);
  _  _     _}_else {
 ___ _  __ __     __preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $s, $matches);
    _   __   _    _ $search_terms = array_map(create_function('$a','return trim($a, "\\"\'\\n\\r_");'), $matches[0]);
_ _         }
 _  }
   _return $search_terms;
}

A:

I have done_few of_changes_to my code,_though_it seems_lot of code but its working fine_as per_my requirement.
add_filter('posts_join', 'websmart_search_join' );
add_filter('posts_groupby', 'websmart_search_groupby' );
add_filter('posts_where',_'websmart_search_where' );

function websmart_search_join( $join_)_{
    global $wpdb;
_   if( is_search() &&!is_admin())_{
    ___    _$join.= "LEFT JOIN $wpdb->postmeta AS m_ON ($wpdb->posts.ID =_m.post_id) ";
     __     $join.=_"LEFT_JOIN $wpdb->term_relationships AS tr ON ($wpdb->posts.ID_=_tr.object_id)_ ";
   _     _  $join.= "LEFT JOIN $wpdb->term_taxonomy AS tt ON_(tt.term_taxonomy_id=tr.term_taxonomy_id