Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
osticket
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
docker
osticket
Commits
b42ce54d
Commit
b42ce54d
authored
6 years ago
by
Peter Rotich
Browse files
Options
Downloads
Patches
Plain Diff
Limit search results to 500 records
parent
9fea8016
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/class.search.php
+6
-3
6 additions, 3 deletions
include/class.search.php
with
6 additions
and
3 deletions
include/class.search.php
+
6
−
3
View file @
b42ce54d
...
...
@@ -483,7 +483,7 @@ class MysqlSearchBackend extends SearchBackend {
LEFT JOIN `"
.
TABLE_PREFIX
.
"_search` A2 ON (A1.`id` = A2.`object_id` AND A2.`object_type`='H')
WHERE A2.`object_id` IS NULL AND (A1.poster <> 'SYSTEM')
AND (LENGTH(A1.`title`) + LENGTH(A1.`body`) > 0)
LIMIT 500"
;
ORDER BY A1.`id` DESC
LIMIT 500"
;
if
(
!
(
$res
=
db_query_unbuffered
(
$sql
,
$auto_create
)))
return
false
;
...
...
@@ -503,7 +503,7 @@ class MysqlSearchBackend extends SearchBackend {
$sql
=
"SELECT A1.`ticket_id` FROM `"
.
TICKET_TABLE
.
"` A1
LEFT JOIN `"
.
TABLE_PREFIX
.
"_search` A2 ON (A1.`ticket_id` = A2.`object_id` AND A2.`object_type`='T')
WHERE A2.`object_id` IS NULL
LIMIT 300"
;
ORDER BY A1.`ticket_id` DESC
LIMIT 300"
;
if
(
!
(
$res
=
db_query_unbuffered
(
$sql
,
$auto_create
)))
return
false
;
...
...
@@ -897,6 +897,7 @@ class SavedQueue extends CustomQueue {
if
(
$criteria
&&
is_array
(
$criteria
))
$queues
->
filter
(
$criteria
);
$counts
=
array
();
$query
=
Ticket
::
objects
();
// Apply tickets visibility for the agent
$query
=
$agent
->
applyVisibility
(
$query
);
...
...
@@ -910,6 +911,8 @@ class SavedQueue extends CustomQueue {
// Add extra tables joins (if any)
if
(
$Q
->
extra
&&
isset
(
$Q
->
extra
[
'tables'
]))
{
$counts
[
'q'
.
$queue
->
getId
()]
=
500
;
continue
;
$contraints
=
array
();
if
(
$Q
->
constraints
)
$constraints
=
new
Q
(
$Q
->
constraints
);
...
...
@@ -919,7 +922,7 @@ class SavedQueue extends CustomQueue {
}
try
{
$counts
=
$query
->
values
()
->
one
();
$counts
=
array_merge
(
$counts
,
$query
->
values
()
->
one
()
)
;
}
catch
(
Exception
$ex
)
{
foreach
(
$queues
as
$q
)
$counts
[
'q'
.
$q
->
getId
()]
=
$q
->
getTotal
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment