@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

When running a fulltext query with no query, enforce order by document creation date

Summary:
Fixes T11929. When running with a query, we no longer enforce an order on the subquery join to produce results more quickly when searching for common strings.

However, this means that empty queries (like those issued by "Close as Duplicate") don't order subquery results.

Restore a `dateCreated` order if there is no query text.

Test Plan: Artificially set limit to 10, still saw 10 most recent tasks.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11929

Differential Revision: https://secure.phabricator.com/D16960

+13 -2
+13 -2
src/applications/search/fulltextstorage/PhabricatorMySQLFulltextStorageEngine.php
··· 347 347 $where = ''; 348 348 } 349 349 350 + if (strlen($compiled_query)) { 351 + $order = ''; 352 + } else { 353 + // When not executing a query, order by document creation date. This 354 + // is the default view in object browser dialogs, like "Close Duplicate". 355 + $order = qsprintf( 356 + $conn, 357 + 'ORDER BY document.documentCreated DESC'); 358 + } 359 + 350 360 return qsprintf( 351 361 $conn, 352 - 'SELECT %Q FROM %T document %Q %Q LIMIT 1000', 362 + 'SELECT %Q FROM %T document %Q %Q %Q LIMIT 1000', 353 363 $select, 354 364 $document_table, 355 365 $join, 356 - $where); 366 + $where, 367 + $order); 357 368 } 358 369 359 370 protected function joinRelationship(