mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 16:52: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/condition');
|
||||||
phutil_require_module('phabricator', 'applications/herald/storage/rule');
|
phutil_require_module('phabricator', 'applications/herald/storage/rule');
|
||||||
phutil_require_module('phabricator', 'applications/phid/handle/data');
|
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/base');
|
||||||
phutil_require_module('phabricator', 'view/form/control/submit');
|
phutil_require_module('phabricator', 'view/form/control/submit');
|
||||||
phutil_require_module('phabricator', 'view/layout/panel');
|
phutil_require_module('phabricator', 'view/layout/panel');
|
||||||
|
|
|
@ -42,14 +42,14 @@ class PhabricatorSearchMySQLExecutor extends PhabricatorSearchExecutor {
|
||||||
$conn_r,
|
$conn_r,
|
||||||
'MATCH(corpus) AGAINST (%s)',
|
'MATCH(corpus) AGAINST (%s)',
|
||||||
$q);
|
$q);
|
||||||
/*
|
|
||||||
if ($query->getParameter('order') == AdjutantQuery::ORDER_RELEVANCE) {
|
// if ($query->getParameter('order') == AdjutantQuery::ORDER_RELEVANCE) {
|
||||||
$order = qsprintf(
|
$order = qsprintf(
|
||||||
$conn_r,
|
$conn_r,
|
||||||
'ORDER BY MATCH(corpus) AGAINST (%s) DESC',
|
'ORDER BY MAX(MATCH(corpus) AGAINST (%s)) DESC',
|
||||||
$q);
|
$q);
|
||||||
}
|
// }
|
||||||
*/
|
|
||||||
$field = $query->getParameter('field');
|
$field = $query->getParameter('field');
|
||||||
if ($field/* && $field != AdjutantQuery::FIELD_ALL*/) {
|
if ($field/* && $field != AdjutantQuery::FIELD_ALL*/) {
|
||||||
$where[] = qsprintf(
|
$where[] = qsprintf(
|
||||||
|
@ -130,11 +130,16 @@ class PhabricatorSearchMySQLExecutor extends PhabricatorSearchExecutor {
|
||||||
|
|
||||||
$hits = queryfx_all(
|
$hits = queryfx_all(
|
||||||
$conn_r,
|
$conn_r,
|
||||||
'SELECT DISTINCT
|
'SELECT
|
||||||
document.phid,
|
document.phid,
|
||||||
document.documentType,
|
document.documentType,
|
||||||
document.documentTitle,
|
document.documentTitle,
|
||||||
document.documentCreated FROM %T document %Q %Q %Q
|
document.documentCreated
|
||||||
|
FROM %T document
|
||||||
|
%Q
|
||||||
|
%Q
|
||||||
|
GROUP BY document.phid
|
||||||
|
%Q
|
||||||
LIMIT 50',
|
LIMIT 50',
|
||||||
$t_doc,
|
$t_doc,
|
||||||
$join,
|
$join,
|
||||||
|
|
Loading…
Reference in a new issue