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:
13
fts.php
13
fts.php
@@ -365,11 +365,14 @@ class fts
|
||||
if ($end === false)
|
||||
$end = strlen ($query);
|
||||
$nbchars = $end - $offset;
|
||||
if ($debug) echo "WORD FOUND (Start $offset with $nbchars chars)\n";
|
||||
$token = substr ($query, $offset, $nbchars);
|
||||
$tokens[] = $token;
|
||||
$sentences[] = false;
|
||||
$minuses[] = $minus;
|
||||
if ($nbchars > 0)
|
||||
{
|
||||
if ($debug) echo "WORD FOUND (Start $offset with $nbchars chars)\n";
|
||||
$token = substr ($query, $offset, $nbchars);
|
||||
$tokens[] = $token;
|
||||
$sentences[] = false;
|
||||
$minuses[] = $minus;
|
||||
}
|
||||
$offset = $end + 1;
|
||||
}
|
||||
if ($debug) print_r ($tokens);
|
||||
|
||||
Reference in New Issue
Block a user