From 6edf98eb3b8a30f9805f50775394d1eb57733dae Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 11 Sep 2017 16:22:39 -0700 Subject: [PATCH] Unprototype the Ferret UI fields Summary: Ref T12819. Show the new Ferret engine fields (and enable the indexer) unconditionally. Also pull them to the top since they're fairly general-purpose and appear more broadly now, and also they actually work correctly (WOW). Some redundant fields (like "Name Contains" in Repositories and Owners) could probably be removed now, I may clean those up in a followup. Test Plan: Browsed around, saw Ferret fields in UI without "(Prototype)" suffix. Reviewers: chad Reviewed By: chad Maniphest Tasks: T12819 Differential Revision: https://secure.phabricator.com/D18587 --- .../search/engine/PhabricatorApplicationSearchEngine.php | 3 +++ .../PhabricatorFerretSearchEngineExtension.php | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php index 6122e66e23..f4c460ce34 100644 --- a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php +++ b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php @@ -324,6 +324,9 @@ abstract class PhabricatorApplicationSearchEngine extends Phobject { $result = $head + $body + $tail; + // Force the fulltext "query" field to the top unconditionally. + $result = array_select_keys($result, array('query')) + $result; + foreach ($this->getHiddenFields() as $hidden_key) { unset($result[$hidden_key]); } diff --git a/src/applications/search/engineextension/PhabricatorFerretSearchEngineExtension.php b/src/applications/search/engineextension/PhabricatorFerretSearchEngineExtension.php index 02aadf7336..65822b0a32 100644 --- a/src/applications/search/engineextension/PhabricatorFerretSearchEngineExtension.php +++ b/src/applications/search/engineextension/PhabricatorFerretSearchEngineExtension.php @@ -6,7 +6,7 @@ final class PhabricatorFerretSearchEngineExtension const EXTENSIONKEY = 'ferret'; public function isExtensionEnabled() { - return PhabricatorEnv::getEnvConfig('phabricator.show-prototypes'); + return true; } public function getExtensionName() { @@ -56,7 +56,7 @@ final class PhabricatorFerretSearchEngineExtension $fields[] = id(new PhabricatorSearchTextField()) ->setKey('query') - ->setLabel(pht('Query (Prototype)')) + ->setLabel(pht('Query')) ->setDescription(pht('Fulltext search.')); return $fields;