Page MenuHomePhabricator

D18661.diff
No OneTemporary

D18661.diff

diff --git a/src/applications/search/engine/PhabricatorJumpNavHandler.php b/src/applications/search/engine/PhabricatorJumpNavHandler.php
--- a/src/applications/search/engine/PhabricatorJumpNavHandler.php
+++ b/src/applications/search/engine/PhabricatorJumpNavHandler.php
@@ -50,17 +50,35 @@
return id(new AphrontRedirectResponse())
->setURI("/diffusion/symbol/$symbol/?jump=true$context");
case 'find-repository':
- $name = $matches[1];
+ $raw_query = $matches[1];
+
+ $engine = id(new PhabricatorRepository())
+ ->newFerretEngine();
+
+ $compiler = id(new PhutilSearchQueryCompiler())
+ ->setEnableFunctions(true);
+
+ $raw_tokens = $compiler->newTokens($raw_query);
+
+ $fulltext_tokens = array();
+ foreach ($raw_tokens as $raw_token) {
+ $fulltext_token = id(new PhabricatorFulltextToken())
+ ->setToken($raw_token);
+ $fulltext_tokens[] = $fulltext_token;
+ }
+
$repositories = id(new PhabricatorRepositoryQuery())
->setViewer($viewer)
- ->withNameContains($name)
+ ->withFerretConstraint($engine, $fulltext_tokens)
->execute();
if (count($repositories) == 1) {
// Just one match, jump to repository.
$uri = head($repositories)->getURI();
} else {
// More than one match, jump to search.
- $uri = urisprintf('/diffusion/?order=name&name=%s', $name);
+ $uri = urisprintf(
+ '/diffusion/?order=name&query=%s',
+ $raw_query);
}
return id(new AphrontRedirectResponse())->setURI($uri);
default:

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 6:53 PM (18 h, 59 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6779298
Default Alt Text
D18661.diff (1 KB)

Event Timeline