Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13968520
D18254.id43903.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D18254.id43903.diff
View Options
diff --git a/src/applications/search/fulltextstorage/PhabricatorMySQLFulltextStorageEngine.php b/src/applications/search/fulltextstorage/PhabricatorMySQLFulltextStorageEngine.php
--- a/src/applications/search/fulltextstorage/PhabricatorMySQLFulltextStorageEngine.php
+++ b/src/applications/search/fulltextstorage/PhabricatorMySQLFulltextStorageEngine.php
@@ -235,7 +235,7 @@
$value = $stemmer->stemToken($value);
}
- if (phutil_utf8_strlen($value) < $min_length) {
+ if ($this->isShortToken($value, $min_length)) {
$fulltext_token->setIsShort(true);
continue;
}
@@ -549,4 +549,22 @@
return array($min_len, $stopwords);
}
+ private function isShortToken($value, $min_length) {
+ // NOTE: The engine tokenizes internally on periods, so terms in the form
+ // "ab.cd", where short substrings are separated by periods, do not produce
+ // any queryable tokens. These terms are meaningful if at least one
+ // substring is longer than the minimum length, like "example.py". See
+ // T12928.
+
+ $parts = preg_split('/[.]+/', $value);
+
+ foreach ($parts as $part) {
+ if (phutil_utf8_strlen($part) >= $min_length) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Oct 17 2024, 9:39 PM (4 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6723540
Default Alt Text
D18254.id43903.diff (1 KB)
Attached To
Mode
D18254: Identify compound short search tokens in the form "xx.yy" as unqueryable in the search UI
Attached
Detach File
Event Timeline
Log In to Comment