Main Website RSS FeedCurrent Article

Fix for Search Everything Wordpress Plugin

Finally i can activate the Search Everything plugin once again (i temporarily disabled it after upgrading to Wordpress 2.1 because of producing duplicate results. Especially if the results can be found on multiple pages). And fortunately there’s someone already found a solution for this problem (many thanks to Tiago Pocinho by creating a fix for this problem)

To fix this problem, you can simply add below lines to the search everything plugin :

add_filter(’posts_request’, ‘SE2_distinct’);
function SE2_distinct($query){
  global $wp_query;
 
  if (!empty($wp_query->query_vars['s'])) {
    if (strstr($where, ‘DISTINCT’)) {}
    else {
      $query = str_replace(’SELECT’, ‘SELECT DISTINCT’, $query);
    }
  }
  return $query;
}

Yep .. that’s all .. but just in case you want to see a detailed description of this problem, you can see it at Search Everything page at Google Code

RSS Feed for This Post3 Comment(s)

  1. 1
    Dan | Feb 23, 2007 at 2:52 / 2:52 AM | Links to this comments | Reply

    I applied this fix and released 3.0 yesterday.

    dancameron.org/wordpress

  2. 2
    Dan | Feb 23, 2007 at 2:52 / 2:52 AM | Links to this comments | Reply

    Oh, and THANK YOU.

  3. 3
    Reaper-X | Feb 23, 2007 at 10:25 / 10:25 AM | Links to this comments | Reply

    Actually i should be thanking you Dan because of your wonderful search everything plugin and by visiting this small blog :)

2 Trackback(s)

  1. From Reiner Saddey’s Place » How to prevent Search Everything from returning duplicate hits with WordPress 2.1 | Feb 20, 2007
  2. From PLR Articles - Monthly Private Label Articles | Apr 23, 2008

RSS Feed for This PostPost a Comment

Line and paragraph breaks automatic, e-mail address never displayed, avoid using spammy words or phrases to prevent your comment from going into the oblivion, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>