fts : do not add an ending (empty) token

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@6106 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2020-09-08 14:20:07 +00:00
parent 6429f6654c
commit ccc0b08d35

13
fts.php
View File

@@ -365,11 +365,14 @@ class fts
if ($end === false) if ($end === false)
$end = strlen ($query); $end = strlen ($query);
$nbchars = $end - $offset; $nbchars = $end - $offset;
if ($debug) echo "WORD FOUND (Start $offset with $nbchars chars)\n"; if ($nbchars > 0)
$token = substr ($query, $offset, $nbchars); {
$tokens[] = $token; if ($debug) echo "WORD FOUND (Start $offset with $nbchars chars)\n";
$sentences[] = false; $token = substr ($query, $offset, $nbchars);
$minuses[] = $minus; $tokens[] = $token;
$sentences[] = false;
$minuses[] = $minus;
}
$offset = $end + 1; $offset = $end + 1;
} }
if ($debug) print_r ($tokens); if ($debug) print_r ($tokens);