pass order from unified search to file search
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
bfe3712372
commit
a0fb6d2518
|
@ -30,12 +30,14 @@ declare(strict_types=1);
|
||||||
namespace OCA\Files\Search;
|
namespace OCA\Files\Search;
|
||||||
|
|
||||||
use OC\Files\Search\SearchComparison;
|
use OC\Files\Search\SearchComparison;
|
||||||
|
use OC\Files\Search\SearchOrder;
|
||||||
use OC\Files\Search\SearchQuery;
|
use OC\Files\Search\SearchQuery;
|
||||||
use OCP\Files\FileInfo;
|
use OCP\Files\FileInfo;
|
||||||
use OCP\Files\IMimeTypeDetector;
|
use OCP\Files\IMimeTypeDetector;
|
||||||
use OCP\Files\IRootFolder;
|
use OCP\Files\IRootFolder;
|
||||||
use OCP\Files\Search\ISearchComparison;
|
use OCP\Files\Search\ISearchComparison;
|
||||||
use OCP\Files\Node;
|
use OCP\Files\Node;
|
||||||
|
use OCP\Files\Search\ISearchOrder;
|
||||||
use OCP\IL10N;
|
use OCP\IL10N;
|
||||||
use OCP\IURLGenerator;
|
use OCP\IURLGenerator;
|
||||||
use OCP\IUser;
|
use OCP\IUser;
|
||||||
|
@ -104,7 +106,9 @@ class FilesSearchProvider implements IProvider {
|
||||||
new SearchComparison(ISearchComparison::COMPARE_LIKE, 'name', '%' . $query->getTerm() . '%'),
|
new SearchComparison(ISearchComparison::COMPARE_LIKE, 'name', '%' . $query->getTerm() . '%'),
|
||||||
$query->getLimit(),
|
$query->getLimit(),
|
||||||
(int)$query->getCursor(),
|
(int)$query->getCursor(),
|
||||||
[],
|
$query->getSortOrder() === ISearchQuery::SORT_DATE_DESC ? [
|
||||||
|
new SearchOrder(ISearchOrder::DIRECTION_DESCENDING, 'mtime'),
|
||||||
|
] : [],
|
||||||
$user
|
$user
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue