kopia lustrzana https://github.com/nextcloud/social
Limit search results to 25 for now
Signed-off-by: Julius Härtl <jus@bitgrid.net>pull/295/head
rodzic
20b8e0a51a
commit
25dd9afe85
|
@ -250,6 +250,7 @@ class CacheActorsRequest extends CacheActorsRequestBuilder {
|
|||
$this->searchInAccount($qb, $search);
|
||||
$this->leftJoinCacheDocuments($qb, 'icon_id');
|
||||
$this->leftJoinDetails($qb);
|
||||
$this->limitResults($qb, 25);
|
||||
|
||||
$accounts = [];
|
||||
$cursor = $qb->execute();
|
||||
|
|
|
@ -190,6 +190,16 @@ class CoreRequestBuilder {
|
|||
$this->limitToDBField($qb, 'token', $token);
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit the results to a given number
|
||||
*
|
||||
* @param IQueryBuilder $qb
|
||||
* @param int $limit
|
||||
*/
|
||||
protected function limitResults(IQueryBuilder $qb, int $limit) {
|
||||
$qb->setMaxResults($limit);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Limit the request to the ActorId
|
||||
|
|
|
@ -128,6 +128,7 @@ class HashtagsRequest extends HashtagsRequestBuilder {
|
|||
public function searchHashtags(string $hashtag): array {
|
||||
$qb = $this->getHashtagsSelectSql();
|
||||
$this->searchInHashtag($qb, $hashtag);
|
||||
$this->limitResults($qb, 25);
|
||||
|
||||
$hashtags = [];
|
||||
$cursor = $qb->execute();
|
||||
|
|
Ładowanie…
Reference in New Issue