File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ func searchHandler(query *Query) error {
44
44
IsStarred : query .IsStarred ,
45
45
OrgId : query .OrgId ,
46
46
DashboardIds : query .DashboardIds ,
47
+ Limit : query .Limit ,
47
48
}
48
49
49
50
if err := bus .Dispatch (& dashQuery ); err != nil {
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ type FindPersistedDashboardsQuery struct {
42
42
UserId int64
43
43
IsStarred bool
44
44
DashboardIds []int
45
+ Limit int
45
46
46
47
Result HitList
47
48
}
Original file line number Diff line number Diff line change @@ -123,6 +123,11 @@ type DashboardSearchProjection struct {
123
123
}
124
124
125
125
func SearchDashboards (query * search.FindPersistedDashboardsQuery ) error {
126
+ limit := query .Limit
127
+ if limit == 0 {
128
+ limit = 1000
129
+ }
130
+
126
131
var sql bytes.Buffer
127
132
params := make ([]interface {}, 0 )
128
133
@@ -165,7 +170,8 @@ func SearchDashboards(query *search.FindPersistedDashboardsQuery) error {
165
170
params = append (params , "%" + query .Title + "%" )
166
171
}
167
172
168
- sql .WriteString (fmt .Sprintf (" ORDER BY dashboard.title ASC LIMIT 1000" ))
173
+ sql .WriteString (fmt .Sprintf (" ORDER BY dashboard.title ASC LIMIT ?" ))
174
+ params = append (params , limit )
169
175
170
176
var res []DashboardSearchProjection
171
177
You can’t perform that action at this time.
0 commit comments