1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Split Ferret engine strings for tokenization on any sequence of whitespace

Summary:
Ref T12819. Currently, strings are split only on spaces, but newlines (and, if they exist, tabs) should also split strings.

Without this, we can fail to get the proper term boundary tokens for words which begin at the start of a line or end at the end of a line.

Test Plan: Reindexed a document with "xyz\nabc", saw `"yz "` and `" ab"` term boundary tokens generate properly.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12819

Differential Revision: https://secure.phabricator.com/D18579
This commit is contained in:
epriestley 2017-09-08 08:06:16 -07:00
parent 4cae4a3b76
commit 7ea6de6e9c

View file

@ -75,7 +75,7 @@ abstract class PhabricatorFerretEngine extends Phobject {
public function tokenizeString($value) {
$value = trim($value, ' ');
$value = preg_split('/ +/', $value);
$value = preg_split('/\s+/u', $value);
return $value;
}