1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-29 10:12:41 +01:00

Warn users that compound terms separated by apostrophes don't work in the MySQL FULLTEXT index either

Summary: Ref T12928. Like `v0.1`, terms in the form `yo's` (sequences of two or fewer characters separated by apostrophes) do not get indexed.

Test Plan: {F5078192}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12928

Differential Revision: https://secure.phabricator.com/D18324
This commit is contained in:
epriestley 2017-08-02 16:01:49 -07:00
parent ba4b936dff
commit cfb86dddd2

View file

@ -554,9 +554,10 @@ final class PhabricatorMySQLFulltextStorageEngine
// "ab.cd", where short substrings are separated by periods, do not produce // "ab.cd", where short substrings are separated by periods, do not produce
// any queryable tokens. These terms are meaningful if at least one // any queryable tokens. These terms are meaningful if at least one
// substring is longer than the minimum length, like "example.py". See // substring is longer than the minimum length, like "example.py". See
// T12928. // T12928. This also applies to words with intermediate apostrophes, like
// "to's".
$parts = preg_split('/[.]+/', $value); $parts = preg_split('/[.\']+/', $value);
foreach ($parts as $part) { foreach ($parts as $part) {
if (phutil_utf8_strlen($part) >= $min_length) { if (phutil_utf8_strlen($part) >= $min_length) {