Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15416474
D17142.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
954 B
Referenced Files
None
Subscribers
None
D17142.diff
View Options
diff --git a/src/applications/owners/typeahead/PhabricatorOwnersPackageDatasource.php b/src/applications/owners/typeahead/PhabricatorOwnersPackageDatasource.php
--- a/src/applications/owners/typeahead/PhabricatorOwnersPackageDatasource.php
+++ b/src/applications/owners/typeahead/PhabricatorOwnersPackageDatasource.php
@@ -22,9 +22,18 @@
$results = array();
$query = id(new PhabricatorOwnersPackageQuery())
- ->withNameNgrams($raw_query)
->setOrder('name');
+ // If the user is querying by monogram explicitly, like "O123", do an ID
+ // search. Otherwise, do an ngram substring search.
+ if (preg_match('/^[oO]\d+\z/', $raw_query)) {
+ $id = trim($raw_query, 'oO');
+ $id = (int)$id;
+ $query->withIDs(array($id));
+ } else {
+ $query->withNameNgrams($raw_query);
+ }
+
$packages = $this->executeQuery($query);
foreach ($packages as $package) {
$name = $package->getName();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 21, 11:21 AM (1 d, 13 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7715406
Default Alt Text
D17142.diff (954 B)
Attached To
Mode
D17142: Allow "O42" to find packages by monogram in Owners typeaheads
Attached
Detach File
Event Timeline
Log In to Comment