1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-27 01: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:
vrana 2012-09-18 14:09:47 -07:00
parent f7a38df5a5
commit 0e097a5867

View file

@ -16,6 +16,9 @@
* limitations under the License. * limitations under the License.
*/ */
/**
* @group search
*/
final class PhabricatorSearchEngineElastic extends PhabricatorSearchEngine { final class PhabricatorSearchEngineElastic extends PhabricatorSearchEngine {
private $uri; private $uri;
private $timeout; 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['from'] = (int)$query->getParameter('offset', 0);
$spec['size'] = (int)$query->getParameter('limit', 25); $spec['size'] = (int)$query->getParameter('limit', 25);