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)
|
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);
|
||||||
|
|||||||
Reference in New Issue
Block a user