mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-16 10:33:11 -06:00
Fix next_batch
This commit is contained in:
parent
6c969b6c9d
commit
91c82c5198
|
|
@ -218,9 +218,10 @@ func Search(req *http.Request, device *api.Device, syncDB storage.Database, fts
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nb := ""
|
var nextBatchResult *string = nil
|
||||||
if int(result.Total) > nextBatch+len(results) {
|
if int(result.Total) > nextBatch+len(results) {
|
||||||
nb = strconv.Itoa(len(results) + nextBatch)
|
nb := strconv.Itoa(len(results) + nextBatch)
|
||||||
|
nextBatchResult = &nb
|
||||||
}
|
}
|
||||||
|
|
||||||
res := SearchResponse{
|
res := SearchResponse{
|
||||||
|
|
@ -229,7 +230,7 @@ func Search(req *http.Request, device *api.Device, syncDB storage.Database, fts
|
||||||
Count: int(result.Total),
|
Count: int(result.Total),
|
||||||
Groups: Groups{RoomID: groups},
|
Groups: Groups{RoomID: groups},
|
||||||
Results: results,
|
Results: results,
|
||||||
NextBatch: &nb,
|
NextBatch: nextBatchResult,
|
||||||
Highlights: strings.Split(searchReq.SearchCategories.RoomEvents.SearchTerm, " "),
|
Highlights: strings.Split(searchReq.SearchCategories.RoomEvents.SearchTerm, " "),
|
||||||
State: stateForRooms,
|
State: stateForRooms,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue