Permalink
Browse files

* Search fix

  • Loading branch information...
1 parent 32fd33c commit d67d3bf5ab63eb434a27e2225e1712f28c5a3192 @dkobia dkobia committed Mar 3, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 application/controllers/search.php
@@ -97,7 +97,7 @@ public function index($page = 1)
// Title weight = 2
// Description weight = 1
$keyword_string = $keyword_string.$plus."(CASE WHEN incident_title LIKE '%$chunk%' THEN 2 ELSE 0 END) + (CASE WHEN incident_description LIKE '%$chunk%' THEN 1 ELSE 0 END)";
- $where_string = $where_string.$or."incident_title LIKE '%$chunk%' OR incident_description LIKE '%$chunk%'";
+ $where_string = $where_string.$or."(incident_title LIKE '%$chunk%' OR incident_description LIKE '%$chunk%')";
$i++;
}
}
@@ -106,7 +106,7 @@ public function index($page = 1)
{
// Limit the result set to only those reports that have been approved
$where_string .= ' AND incident_active = 1';
- $search_query = "SELECT *, (".$keyword_string.") AS relevance FROM ".$this->table_prefix."incident WHERE (".$where_string.") ORDER BY relevance DESC LIMIT ";
+ $search_query = "SELECT *, (".$keyword_string.") AS relevance FROM ".$this->table_prefix."incident WHERE ".$where_string." ORDER BY relevance DESC LIMIT ";
}
}

0 comments on commit d67d3bf

Please sign in to comment.