Osticket: Ticket search issues with part of the word

Created on 7 Mar 2019  Â·  7Comments  Â·  Source: osTicket/osTicket

Prerequisites

  • [ ] Can you reproduce the problem in a fresh installation of the "develop" branch? N/A
  • [ ] Do you have any errors in the PHP error log, or javascript console? No
  • [ ] Did you check the osTicket forums? Yes, no solution yet
  • [ ] Did you perform a cursory search to see if your bug or enhancement is already reported? Yes look, not found same issue

For more information on how to write a good bug report

Description

When searching in Ticket for part of the word it's not displaying the results
see details reported in forums: https://forum.osticket.com/d/93665-wildcard-search/2

[Description of the bug or feature]
not showing results, it looks like it's finding the results

Steps to Reproduce

  1. [First Step]
    I just tested and it's not working for me too
    I searched for Printer and 25 results came
    Then I searched for Printe nothing came just by removing r in a printer
    then I just searched for Print and 25 more results came

  2. [Second Step]
    What I notice is the display part seems to be not working: As you can see it show there are a number of pages, but not showing
    One more thing I notice is if you search for more then one word, it will find, example if searched for: Printe Problem Then is will find stuff that has to do with word "Problem"

Expected behavior: [What you expected to happen]
it should display whatever searched for to display in search results

Actual behavior: [What actually happened]
it's just showing results of the search is there, but not displaying

Versions

osTicket Version v1.11 (0f229ae) — Up to date
Web Server Software Apache/2.4.29 (Win32) OpenSSL/1.0.2l PHP/7.2.15
MySQL Version 10.1.28
PHP Version 7.2.15

Also, please include the OS and what version of the OS you're running. As well as your browser and browser version.
Tried in Google Chrome Version 72.0.3626.121 (Official Build) (64-bit)

Most helpful comment

I have solved the "500 results issue" in the following way:

file include/class.search.php I have replaced the function:

 function getCount($agent, $cached=true) {
     return 500;

with:

function getCount($agent, $cached=true) {
        $count = null;
        if ($cached && ($counts = self::counts($agent, $cached)))
            $count = $counts["q{$this->getId()}"];
        if ($count == null)
            $count = $this->getTotal($agent);
       return $count;
 }

file include/staff/templates/queue-tickets.tmpl.php I have replaced the following line:

$count = $queue->getCount($thisstaff) ?: (PAGE_LIMIT * 3);

with:

$count = $queue->getCount($thisstaff) ?: 0;

All 7 comments

Even with a search that should have zero results, it shows 500 results and paginates.

image

Yep, always returning 500 would do that. Thanks for showing me! Is returning 500 a placeholder until the "counting" code is written?

@Haabda

That is indeed correct! 😄

Cheers.

so, no solution yet correct?

@ramrajone

The "500 results issue" has no fix yet.

The OG issue you posted of "the system only searches for entire words instead of partial words" has always been like this. Test it in 1.9.x, 1.10.x, etc. the results are always the same. We hope to improve search to include partial word searching in the future so please stay tuned.

Cheers.

I have solved the "500 results issue" in the following way:

file include/class.search.php I have replaced the function:

 function getCount($agent, $cached=true) {
     return 500;

with:

function getCount($agent, $cached=true) {
        $count = null;
        if ($cached && ($counts = self::counts($agent, $cached)))
            $count = $counts["q{$this->getId()}"];
        if ($count == null)
            $count = $this->getTotal($agent);
       return $count;
 }

file include/staff/templates/queue-tickets.tmpl.php I have replaced the following line:

$count = $queue->getCount($thisstaff) ?: (PAGE_LIMIT * 3);

with:

$count = $queue->getCount($thisstaff) ?: 0;
Was this page helpful?
0 / 5 - 0 ratings

Related issues

markus4000 picture markus4000  Â·  3Comments

roman-1983 picture roman-1983  Â·  5Comments

F3000 picture F3000  Â·  5Comments

rob-tv picture rob-tv  Â·  3Comments

ghost picture ghost  Â·  6Comments