mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 08:42:41 +01:00
Improve search relevance.
This commit is contained in:
parent
b060f0a80f
commit
08fc13598d
3 changed files with 14 additions and 8 deletions
|
@ -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');
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue