mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 23:02:42 +01:00
Sort elasticsearch results by date created
Summary: Similar to MySQL search. Test Plan: Displayed Edit Dependencies dialog on revision. Reviewers: epriestley, btrahan Reviewed By: btrahan CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D3519
This commit is contained in:
parent
f7a38df5a5
commit
0e097a5867
1 changed files with 9 additions and 0 deletions
|
@ -16,6 +16,9 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @group search
|
||||
*/
|
||||
final class PhabricatorSearchEngineElastic extends PhabricatorSearchEngine {
|
||||
private $uri;
|
||||
private $timeout;
|
||||
|
@ -177,6 +180,12 @@ final class PhabricatorSearchEngineElastic extends PhabricatorSearchEngine {
|
|||
}
|
||||
}
|
||||
|
||||
if (!$query->getQuery()) {
|
||||
$spec['sort'] = array(
|
||||
array('dateCreated' => 'desc'),
|
||||
);
|
||||
}
|
||||
|
||||
$spec['from'] = (int)$query->getParameter('offset', 0);
|
||||
$spec['size'] = (int)$query->getParameter('limit', 25);
|
||||
|
||||
|
|
Loading…
Reference in a new issue