From 1aaa3139d1dfd7236c576b1278261bc820690a1d Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@osticket.com>
Date: Thu, 15 Oct 2015 19:55:13 +0000
Subject: [PATCH] Require three or more chars to do lookup

Due to MySQL FULLTEXT min-word-lenn requirements (which various from
installation to installation), fulltext-based searches require at least two
characters.
---
 include/ajax.orgs.php    | 2 +-
 include/ajax.tickets.php | 2 +-
 include/ajax.users.php   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/ajax.orgs.php b/include/ajax.orgs.php
index 0cf4f22d6..f7be2b2d1 100644
--- a/include/ajax.orgs.php
+++ b/include/ajax.orgs.php
@@ -29,7 +29,7 @@ class OrgsAjaxAPI extends AjaxController {
         $q = $_REQUEST['q'];
         $limit = isset($_REQUEST['limit']) ? (int) $_REQUEST['limit']:25;
 
-        if (strlen($q) < 2)
+        if (strlen($q) < 3)
             return $this->encode(array());
 
         $orgs = Organization::objects()
diff --git a/include/ajax.tickets.php b/include/ajax.tickets.php
index 35bb513e9..6d726f5a1 100644
--- a/include/ajax.tickets.php
+++ b/include/ajax.tickets.php
@@ -48,7 +48,7 @@ class TicketsAjaxAPI extends AjaxController {
 
         $q = $_REQUEST['q'];
 
-        if (strlen($q) < 2)
+        if (strlen($q) < 3)
             return $this->encode(array());
 
         global $ost;
diff --git a/include/ajax.users.php b/include/ajax.users.php
index bb94a1528..dba3cb1da 100644
--- a/include/ajax.users.php
+++ b/include/ajax.users.php
@@ -34,7 +34,7 @@ class UsersAjaxAPI extends AjaxController {
         $users=array();
         $emails=array();
 
-        if (strlen($q) < 2)
+        if (strlen($q) < 3)
             return $this->encode(array());
 
         if (!$type || !strcasecmp($type, 'remote')) {
-- 
GitLab