MyBB Community Forums

Full Version: failed to search Chinese characters
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
for search function, only English may be searched correctly


for Chinese characters, whenever 2 or 3 or 4 characters keyin search forum, this is always shows below,

One or more of your search terms were shorter than the minimum length. The minimum search term length is 4 characters.
 
Anyone knows how to do?

Thanks!
Admin CP -> Settings -> Search System -> Minimum Search Word Length
(08-28-2018, 04:25 PM)frostschutz Wrote: [ -> ]Admin CP -> Settings -> Search System -> Minimum Search Word Length
I've done that before, but no luck for Chinese characters. Sadly.

--
I'm not sure is it the reason MyBB not so popular in Chinese community?
Should work fine if you set it to 1.

(If you set it to 0, it will use 3 instead, it's kinda weird that way.)

According to the error message you posted above, yours is set to 4.
(08-29-2018, 08:45 AM)frostschutz Wrote: [ -> ]Should work fine if you set it to 1.

(If you set it to 0, it will use 3 instead, it's kinda weird that way.)

According to the error message you posted above, yours is set to 4.

Unfortunately, still no luck!
even though set it to 0 or 1, the error message shows the same Undecided
Can you check inc/settings.php file for minsearch what it says there?

If your inc/settings.php still has the old value, maybe the file is not set to be writable.

Admin CP -> Tools should complain about wrong file permissions in that case.

Admin CP -> Tools should say something like this:

All of the required files and directories have the proper CHMOD settings.
CHMOD Files and Directories
File 	Location
Configuration File 	./inc/config.php 	Writable
Settings File 	./inc/settings.php 	Writable
File Uploads Directory 	./uploads 	Writable
Avatar Uploads Directory 	./uploads/avatars 	Writable
Language Files 	./inc/languages 	Writable
Backups Directory 	./AdminCP/backups 	Writable
Cache Directory 	./cache 	Writable
Themes Directory 	./cache/themes 	Writable
$settings['minsearchword'] = "0";

Configuration File ./inc/config.php Writable
Settings File ./inc/settings.php Writable
File Uploads Directory ./uploads Writable
Avatar Uploads Directory ./uploads/avatars Writable
Language Files ./inc/languages Writable
Backups Directory ./admin/backups Writable
Cache Directory ./cache Writable
Themes Directory ./cache/themes Writable
Avatar Gallery Directory ./images/avatars Writable
set it to 1, not 0
$settings['minsearchword'] = "1";

Nothing change

"One or more of your search terms were shorter than the minimum length. The minimum search term length is 4 characters."
Hmmm, found this bit of code.

/**
 * Perform a thread and post search under MySQL or MySQLi using boolean fulltext capabilities
 *
 * @param array $search Array of search data
 * @return array Array of search data with results mixed in
 */
function perform_search_mysql_ft($search)
{
[...]
       	// Attempt to determine minimum word length from MySQL for fulltext searches
       	$query = $db->query("SHOW VARIABLES LIKE 'ft_min_word_len';");
        $min_length = $db->fetch_field($query, 'Value');
        if(is_numeric($min_length))
        {
               	$mybb->settings['minsearchword'] = $min_length;
        }
        // Otherwise, could not fetch - default back to MySQL fulltext default setting
        else
	{
                $mybb->settings['minsearchword'] = 4;
        }

So it's set to 4 if the database doesn't support otherwise.

And might still be set to 4 if that's what the database returns.

What do you get for SHOW VARIABLES LIKE 'ft_min_word_len';?

Even so - it just works for me, I can search for single word ( 何 ) and get posts that have this word in them.
Pages: 1 2