Skip to content

Commit

Permalink
-Default to boolean search mode.
Browse files Browse the repository at this point in the history
- Fall back to like search if the search term is 4 characters or less (the probable minimum search term length).
  • Loading branch information
tburry committed Apr 15, 2013
1 parent cdfd768 commit 557e7b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions applications/dashboard/models/class.searchmodel.php
Expand Up @@ -101,6 +101,9 @@ public function Search($Search, $Offset = 0, $Limit = 20) {
$SearchMode = 'like';
}

if (strlen($Search) <= 4)
$SearchMode = 'like';

$this->_SearchMode = $SearchMode;

$this->FireEvent('Search');
Expand Down
2 changes: 1 addition & 1 deletion conf/config-defaults.php
Expand Up @@ -92,7 +92,7 @@
$Configuration['Garden']['InputFormatter'] = 'Html'; // Html, BBCode, Markdown, Text
$Configuration['Garden']['Html']['SafeStyles'] = TRUE; // disallow style/class attributes in html to prevent click jacking
$Configuration['Garden']['Html']['AllowedElements'] = "a, abbr, acronym, address, area, audio, b, bdi, bdo, big, blockquote, br, caption, center, cite, code, col, colgroup, dd, del, details, dfn, div, dl, dt, em, figure, figcaption, font, h1, h2, h3, h4, h5, h6, hgroup, hr, i, img, ins, kbd, li, map, mark, menu, meter, ol, p, pre, q, s, samp, small, span, strike, strong, sub, sup, summary, table, tbody, td, tfoot, th, thead, time, tr, tt, u, ul, var, video, wbr";
$Configuration['Garden']['Search']['Mode'] = 'matchboolean'; // matchboolean, match, boolean, like
$Configuration['Garden']['Search']['Mode'] = 'boolean'; // matchboolean, match, boolean, like
$Configuration['Garden']['Theme'] = 'default';
$Configuration['Garden']['MobileTheme'] = 'mobile';
$Configuration['Garden']['Profile']['Public'] = TRUE;
Expand Down

0 comments on commit 557e7b7

Please sign in to comment.