Our tickets contain a lot of IP addresses in the body of the ticket, which we'd like to be able to search as new tickets are created. However, when a search is performed with an IP address known to be in a ticket, no results are returned.I suspect this is more of a limitation of MySQL fulltext searching, but was hoping someone here has found a workaround/solution for this...?

I can confirm on my 1.9.7 that I cannot search for IP addresses either.

I can not search by any information in the body or subject of the ticket.  Any help would be greatly appreciated.ThanksEugene

After a bit of digging, the search optimization is being silly, anything that is numeric (IP address, phone number) is assumed to be a ticket ID.After commenting out some lines in tickets.inc.php in the include/staff folder I got it to search just fine.    if($searchTerm){        $qs += array('query' => $searchTerm);        $queryterm=db_real_escape($searchTerm,false); //escape the term ONLY...no quotes.//        if (is_numeric($searchTerm)) {//            $qwhere.=" AND ticket.`number` LIKE '$queryterm%'";//        } elseif (strpos($searchTerm,'@') && Validator:($searchTerm)) {            //pulling all tricks!            # XXX: What about searching for email addresses in the body of            #      the thread message//            $qwhere.=" AND email.address='$queryterm'";//        } else {//Deep search!            //This sucks..mass scan! search anything that moves!            require_once(INCLUDE_DIR.'ajax.tickets.php');            $tickets = TicketsAjaxApi:(array('query'=>$queryterm));            if (count($tickets)) {                $ticket_ids = implode(',',db_input($tickets));                $qwhere .= ' AND ticket.ticket_id IN ('.$ticket_ids.')';                $order_by = 'FIELD(ticket.ticket_id, '.$ticket_ids.')';                $order = ' ';            }            else                // No hits -- there should be an empty list of results                $qwhere .= ' AND false';//        }   }It's a bit dirty but works.

Write a Reply...