diff --git a/src/applications/herald/controller/rule/__init__.php b/src/applications/herald/controller/rule/__init__.php index 8ce0b727a7..a168848529 100644 --- a/src/applications/herald/controller/rule/__init__.php +++ b/src/applications/herald/controller/rule/__init__.php @@ -18,6 +18,7 @@ phutil_require_module('phabricator', 'applications/herald/storage/action'); phutil_require_module('phabricator', 'applications/herald/storage/condition'); phutil_require_module('phabricator', 'applications/herald/storage/rule'); phutil_require_module('phabricator', 'applications/phid/handle/data'); +phutil_require_module('phabricator', 'infrastructure/javelin/api'); phutil_require_module('phabricator', 'view/form/base'); phutil_require_module('phabricator', 'view/form/control/submit'); phutil_require_module('phabricator', 'view/layout/panel'); diff --git a/src/applications/search/execute/mysql/PhabricatorSearchMySQLExecutor.php b/src/applications/search/execute/mysql/PhabricatorSearchMySQLExecutor.php index 41b2dc8a0b..e28a861507 100644 --- a/src/applications/search/execute/mysql/PhabricatorSearchMySQLExecutor.php +++ b/src/applications/search/execute/mysql/PhabricatorSearchMySQLExecutor.php @@ -42,14 +42,14 @@ class PhabricatorSearchMySQLExecutor extends PhabricatorSearchExecutor { $conn_r, 'MATCH(corpus) AGAINST (%s)', $q); -/* - if ($query->getParameter('order') == AdjutantQuery::ORDER_RELEVANCE) { + +// if ($query->getParameter('order') == AdjutantQuery::ORDER_RELEVANCE) { $order = qsprintf( $conn_r, - 'ORDER BY MATCH(corpus) AGAINST (%s) DESC', + 'ORDER BY MAX(MATCH(corpus) AGAINST (%s)) DESC', $q); - } -*/ +// } + $field = $query->getParameter('field'); if ($field/* && $field != AdjutantQuery::FIELD_ALL*/) { $where[] = qsprintf( @@ -130,11 +130,16 @@ class PhabricatorSearchMySQLExecutor extends PhabricatorSearchExecutor { $hits = queryfx_all( $conn_r, - 'SELECT DISTINCT + 'SELECT document.phid, document.documentType, document.documentTitle, - document.documentCreated FROM %T document %Q %Q %Q + document.documentCreated + FROM %T document + %Q + %Q + GROUP BY document.phid + %Q LIMIT 50', $t_doc, $join, diff --git a/webroot/rsrc/js/application/herald/HeraldRuleEditor.js b/webroot/rsrc/js/application/herald/HeraldRuleEditor.js index a6bce77dda..2937030507 100644 --- a/webroot/rsrc/js/application/herald/HeraldRuleEditor.js +++ b/webroot/rsrc/js/application/herald/HeraldRuleEditor.js @@ -360,4 +360,4 @@ JX.install('HeraldRuleEditor', { return select; } } -}); \ No newline at end of file +});