mirror of
https://github.com/processwire/processwire.git
synced 2025-08-15 19:24:28 +02:00
Update DatabaseQuerySelectFulltext so that too-long words combined with individual word-matching operators are truncated rather than removed.
This commit is contained in:
@@ -1215,6 +1215,7 @@ class DatabaseQuerySelectFulltext extends Wire {
|
|||||||
'stopwords' => true, // allow stopwords
|
'stopwords' => true, // allow stopwords
|
||||||
'indexable' => false, // include only indexable words?
|
'indexable' => false, // include only indexable words?
|
||||||
'alternates' => false, // include alternate versions of words?
|
'alternates' => false, // include alternate versions of words?
|
||||||
|
'truncate' => true,
|
||||||
);
|
);
|
||||||
|
|
||||||
$options = count($options) ? array_merge($defaults, $options) : $defaults;
|
$options = count($options) ? array_merge($defaults, $options) : $defaults;
|
||||||
@@ -1312,6 +1313,7 @@ class DatabaseQuerySelectFulltext extends Wire {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
protected function strlen($value) {
|
protected function strlen($value) {
|
||||||
|
$value = (string) $value;
|
||||||
if(function_exists('mb_strlen')) {
|
if(function_exists('mb_strlen')) {
|
||||||
return mb_strlen($value);
|
return mb_strlen($value);
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user