Please or Register to create posts and topics.

Search has minimum of 4 characters?

Page 1 of 2Next

It appears to me that the search doesn’t return any results if you enter less than 4 characters. Where can I change this?

Hello @traceyh

This is a limitation caused by the configuration of your MySQL database server. For fulltext-search there is a minimum string-length of FOUR I guess. There are also certain stopwords which are ignored while performing a search inside your database. You can read more about those limitations here:

So this is not a bug/problem caused by Asgaros Forum. To change this default configuration you have to modify the configuration of your database-server directly. If you dont know how to do this you should contact your hosting-provider.

traceyh has reacted to this post.
traceyh
If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

Thank you for your response!

Asgaros has reacted to this post.
Asgaros
Quote from Asgaros on October 9, 2018, 12:08 pm

This is a limitation caused by the configuration of your MySQL database server. For fulltext-search there is a minimum string-length of FOUR I guess. There are also certain stopwords which are ignored while performing a search inside your database. You can read more about those limitations here:

So this is not a bug/problem caused by Asgaros Forum. To change this default configuration you have to modify the configuration of your database-server directly. If you dont know how to do this you should contact your hosting-provider.

I just ran into this issue because I need to provide search results for a 3-letter string. The main site does support 3-letter searches for everything but the Forum Search does not. Is it not using the same database server? If so, surely there must be a setting somewhere for the administrator to change. I’d even be happy if I could make a list of 3-letter keywords to be sought by search and leave the otherwise general 4-letter minimum alone.

On further trial searches using the Forum Search on my site, I realise that it is not the length of the string that is the issue; it is whether the string is recognised by some dictionary or concordance or is a purely alphabetical string. These are all found: red, tag, sql but rm8 is not. “rmn” is; it is present in a string in the Forum.

The main Search does find “rm8” in Blog posts so why doesn’t the Forum search find “rm8” in Forum posts?

On further testing, I think the reason that the search term “rm8″ returns no results when there are instances of ” rm8 ” in the Forum posts is because there is no instance of a longer string beginning with “rm8″. If there is an instance of ” rm8sql ” in the text, then its Topic is returned as a result. Yet the Theme Search does find instances of ” rm8 ” in Blog posts so there is a difference between the two systems’ Full Text Search engines or configurations. I’d like them to behave the same way for consistency on the same site and my preferred way is that of the Theme Search.

@asgaros this is a tickle in case you don’t get notices of replies to old discussions. Please see the three prior posts I’ve made. Is there anything I can do to make the Forum Search act the same way as the Theme Search? Or, at the very least, to enable the Forum Search to find 3-character words or strings, e.g., acronyms?

To @traceyh and @ve3meo

Here is my picture of your issues.

The Asgaros forum is by default using the MyISAM storage engine for the MySQL database.

MyISAM storage engine has the default value of four characters minimum for searches.
Server variable is: “ft_min_word_len”
https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_ft_min_word_len

A better storage engine solution is to use InnoDB, where searches with three characters is the default minimum.
Server variable is: ”innodb_ft_min_token_size”
https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_ft_min_token_size

You can verify your web hosting configuration with the phpMyAdmin tab: ”Server variables and settings”.

Solution for three character search is to change from MyISAM to InnoDB:

Verify that your Asgaros Forum tables:

forum_ads
forum_forums
forum_polls
forum_polls_options
forum_polls_votes
forum_posts
forum_reactions
forum_reports
forum_topics

are MyISAM with phpMyAdmin column ”Type”.

Ensure that you are running MySQL 5.6.4 or higher otherwise you might run into issues
because full-text indexing must be supported by InnoDB.

Make a database backup.

If you have MySQL 5.6.4 or higher change the MySQL storage engine to InnoDB
with phpMyAdmin table by table using the ”Operations” tab and select InnoDB as the ”Storage Engine”.

Note:

@ve3meo your other plugin managing three character searches is probably already using InnoDB.

Some web hostings have changed the MyISAM default value to three characters
like my web hosting which makes these steps unnecessary
but InnoDB should always be considered as a better Storage Engine than MyISAM.

ve3meo has reacted to this post.
ve3meo

Hmm, that looks encouraging @veronica! But a bit puzzling, too because only wp_forum_posts and wp_forum_topics are MyISAM; the rest are InnoDB as are all the wp and other plugin tables. Makes me think that Asgaros Forums requires MyISAM…

MySQL is 10.2 Maria

Willing to give it a go. Should I backup the whole system or just the two tables being changed? If the latter, is that just copying each table to another table? And to restore, delete the converted one’s contents and copy from the backup? Or better to Export to CSV and Import to restore?

Quote from Asgaros on November 19, 2018, 6:20 am

No, there is no other reason than the one in the comment. During the installation of Asgaros Forum is set it to MyISAm to guarantee best compatibility for all server-configurations out there. If you are using a database-version which supports FULLTEXT indexes using InnoDB as an engine, you can change it without any problems.

You can read this thread: https://asgaros.com/support/topic/database-and-table-engines/

You can make copies of the tables with phpMyAdmin

Asgaros has reacted to this post.
Asgaros
Page 1 of 2Next