1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 08:42:41 +01:00

Remove Ferret function aliases and overrides

Summary:
Ref T13511. Ferret functions currently define "aliases", and some applications override the default aliases.

This probably isn't really the right model, since it means the available function aliases in global search depend on the types of documents you're searching for. This isn't fundamentally unworkable but is kind of weird.

Regardless, these don't actually work. Searching for "description:x" is a syntax error.

Since they don't work, it's a good bet no one is relying on them. Just get rid of them until there's a clearer argument for the feature.

Test Plan: Grepped for "getFunctionMap", got no other hits. Ran some queries with the alias functions, got syntax errors.

Maniphest Tasks: T13511

Differential Revision: https://secure.phabricator.com/D21130
This commit is contained in:
epriestley 2020-04-16 10:27:01 -07:00
parent 9bdf477f2f
commit 894d9b6587
3 changed files with 1 additions and 27 deletions

View file

@ -15,12 +15,4 @@ final class DifferentialRevisionFerretEngine
return new DifferentialRevisionSearchEngine();
}
protected function getFunctionMap() {
$map = parent::getFunctionMap();
$map['body']['aliases'][] = 'summary';
return $map;
}
}

View file

@ -15,13 +15,4 @@ final class ManiphestTaskFerretEngine
return new ManiphestTaskSearchEngine();
}
protected function getFunctionMap() {
$map = parent::getFunctionMap();
$map['body']['aliases'][] = 'desc';
$map['body']['aliases'][] = 'description';
return $map;
}
}

View file

@ -29,31 +29,22 @@ abstract class PhabricatorFerretEngine extends Phobject {
return $map[$function]['field'];
}
protected function getFunctionMap() {
private function getFunctionMap() {
return array(
'all' => array(
'field' => PhabricatorSearchDocumentFieldType::FIELD_ALL,
'aliases' => array(
'any',
),
),
'title' => array(
'field' => PhabricatorSearchDocumentFieldType::FIELD_TITLE,
'aliases' => array(),
),
'body' => array(
'field' => PhabricatorSearchDocumentFieldType::FIELD_BODY,
'aliases' => array(),
),
'core' => array(
'field' => PhabricatorSearchDocumentFieldType::FIELD_CORE,
'aliases' => array(),
),
'comment' => array(
'field' => PhabricatorSearchDocumentFieldType::FIELD_COMMENT,
'aliases' => array(
'comments',
),
),
);
}